pdftex[780] branches/stable/source: sync from TL dev sources, 1 Nov

commits+karl at tug.org commits+karl at tug.org
Wed Nov 1 19:15:56 CET 2017


Revision: 780
          http://tug.org/svn/pdftex?view=revision&revision=780
Author:   karl
Date:     2017-11-01 19:15:56 +0100 (Wed, 01 Nov 2017)
Log Message:
-----------
sync from TL dev sources, 1 Nov 2017, r45666

Revision Links:
--------------
    http://tug.org/svn/pdftex?view=revision&revision=45666

Modified Paths:
--------------
    branches/stable/source/src/Makefile.in
    branches/stable/source/src/aclocal.m4
    branches/stable/source/src/auxdir/auxsub/Makefile.in
    branches/stable/source/src/auxdir/auxsub/aclocal.m4
    branches/stable/source/src/build-aux/ar-lib
    branches/stable/source/src/build-aux/compile
    branches/stable/source/src/build-aux/config.guess
    branches/stable/source/src/build-aux/config.sub
    branches/stable/source/src/build-aux/depcomp
    branches/stable/source/src/build-aux/install-sh
    branches/stable/source/src/build-aux/missing
    branches/stable/source/src/build-aux/test-driver
    branches/stable/source/src/build-aux/texinfo.tex
    branches/stable/source/src/build-aux/ylwrap
    branches/stable/source/src/configure
    branches/stable/source/src/doc/Makefile.in
    branches/stable/source/src/doc/build-tools.txt
    branches/stable/source/src/doc/tlbuild.info
    branches/stable/source/src/libs/Makefile.in
    branches/stable/source/src/libs/README
    branches/stable/source/src/libs/aclocal.m4
    branches/stable/source/src/libs/configure
    branches/stable/source/src/libs/libpng/ChangeLog
    branches/stable/source/src/libs/libpng/Makefile.in
    branches/stable/source/src/libs/libpng/README
    branches/stable/source/src/libs/libpng/TLpatches/ChangeLog
    branches/stable/source/src/libs/libpng/TLpatches/TL-Changes
    branches/stable/source/src/libs/libpng/aclocal.m4
    branches/stable/source/src/libs/libpng/configure
    branches/stable/source/src/libs/libpng/include/Makefile.in
    branches/stable/source/src/libs/libpng/libpng-src/ANNOUNCE
    branches/stable/source/src/libs/libpng/libpng-src/CHANGES
    branches/stable/source/src/libs/libpng/libpng-src/CMakeLists.txt
    branches/stable/source/src/libs/libpng/libpng-src/INSTALL
    branches/stable/source/src/libs/libpng/libpng-src/LICENSE
    branches/stable/source/src/libs/libpng/libpng-src/Makefile.am
    branches/stable/source/src/libs/libpng/libpng-src/README
    branches/stable/source/src/libs/libpng/libpng-src/arm/filter_neon.S
    branches/stable/source/src/libs/libpng/libpng-src/configure.ac
    branches/stable/source/src/libs/libpng/libpng-src/contrib/arm-neon/android-ndk.c
    branches/stable/source/src/libs/libpng/libpng-src/contrib/arm-neon/linux.c
    branches/stable/source/src/libs/libpng/libpng-src/contrib/examples/pngtopng.c
    branches/stable/source/src/libs/libpng/libpng-src/contrib/gregbook/README
    branches/stable/source/src/libs/libpng/libpng-src/contrib/gregbook/readpng.c
    branches/stable/source/src/libs/libpng/libpng-src/contrib/gregbook/readpng2.c
    branches/stable/source/src/libs/libpng/libpng-src/contrib/gregbook/readppm.c
    branches/stable/source/src/libs/libpng/libpng-src/contrib/gregbook/rpng-win.c
    branches/stable/source/src/libs/libpng/libpng-src/contrib/gregbook/rpng-x.c
    branches/stable/source/src/libs/libpng/libpng-src/contrib/gregbook/rpng2-win.c
    branches/stable/source/src/libs/libpng/libpng-src/contrib/gregbook/rpng2-x.c
    branches/stable/source/src/libs/libpng/libpng-src/contrib/gregbook/wpng.c
    branches/stable/source/src/libs/libpng/libpng-src/contrib/gregbook/writepng.c
    branches/stable/source/src/libs/libpng/libpng-src/contrib/libtests/pngstest.c
    branches/stable/source/src/libs/libpng/libpng-src/contrib/libtests/pngunknown.c
    branches/stable/source/src/libs/libpng/libpng-src/contrib/libtests/pngvalid.c
    branches/stable/source/src/libs/libpng/libpng-src/contrib/pngminus/png2pnm.c
    branches/stable/source/src/libs/libpng/libpng-src/contrib/pngminus/pnm2png.c
    branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/makepngs.sh
    branches/stable/source/src/libs/libpng/libpng-src/contrib/tools/genpng.c
    branches/stable/source/src/libs/libpng/libpng-src/contrib/tools/pngfix.c
    branches/stable/source/src/libs/libpng/libpng-src/contrib/tools/sRGB.h
    branches/stable/source/src/libs/libpng/libpng-src/contrib/visupng/PngFile.c
    branches/stable/source/src/libs/libpng/libpng-src/contrib/visupng/VisualPng.c
    branches/stable/source/src/libs/libpng/libpng-src/example.c
    branches/stable/source/src/libs/libpng/libpng-src/intel/filter_sse2_intrinsics.c
    branches/stable/source/src/libs/libpng/libpng-src/libpng-manual.txt
    branches/stable/source/src/libs/libpng/libpng-src/libpng.3
    branches/stable/source/src/libs/libpng/libpng-src/libpng.pc.in
    branches/stable/source/src/libs/libpng/libpng-src/libpngpf.3
    branches/stable/source/src/libs/libpng/libpng-src/png.5
    branches/stable/source/src/libs/libpng/libpng-src/png.c
    branches/stable/source/src/libs/libpng/libpng-src/png.h
    branches/stable/source/src/libs/libpng/libpng-src/pngconf.h
    branches/stable/source/src/libs/libpng/libpng-src/pngerror.c
    branches/stable/source/src/libs/libpng/libpng-src/pngget.c
    branches/stable/source/src/libs/libpng/libpng-src/pnginfo.h
    branches/stable/source/src/libs/libpng/libpng-src/pnglibconf.h
    branches/stable/source/src/libs/libpng/libpng-src/pngpread.c
    branches/stable/source/src/libs/libpng/libpng-src/pngpriv.h
    branches/stable/source/src/libs/libpng/libpng-src/pngread.c
    branches/stable/source/src/libs/libpng/libpng-src/pngrtran.c
    branches/stable/source/src/libs/libpng/libpng-src/pngrutil.c
    branches/stable/source/src/libs/libpng/libpng-src/pngset.c
    branches/stable/source/src/libs/libpng/libpng-src/pngstruct.h
    branches/stable/source/src/libs/libpng/libpng-src/pngtest.c
    branches/stable/source/src/libs/libpng/libpng-src/pngtest.png
    branches/stable/source/src/libs/libpng/libpng-src/pngtrans.c
    branches/stable/source/src/libs/libpng/libpng-src/pngwrite.c
    branches/stable/source/src/libs/libpng/libpng-src/pngwutil.c
    branches/stable/source/src/libs/libpng/libpng-src/projects/owatcom/pngconfig.mak
    branches/stable/source/src/libs/libpng/libpng-src/projects/vstudio/README.txt
    branches/stable/source/src/libs/libpng/libpng-src/projects/vstudio/zlib.props
    branches/stable/source/src/libs/libpng/libpng-src/scripts/README.txt
    branches/stable/source/src/libs/libpng/libpng-src/scripts/def.c
    branches/stable/source/src/libs/libpng/libpng-src/scripts/libpng-config-head.in
    branches/stable/source/src/libs/libpng/libpng-src/scripts/libpng.pc.in
    branches/stable/source/src/libs/libpng/libpng-src/scripts/makefile.cegcc
    branches/stable/source/src/libs/libpng/libpng-src/scripts/makefile.linux
    branches/stable/source/src/libs/libpng/libpng-src/scripts/makefile.msys
    branches/stable/source/src/libs/libpng/libpng-src/scripts/makefile.ne12bsd
    branches/stable/source/src/libs/libpng/libpng-src/scripts/makefile.netbsd
    branches/stable/source/src/libs/libpng/libpng-src/scripts/makefile.openbsd
    branches/stable/source/src/libs/libpng/libpng-src/scripts/makefile.solaris-x86
    branches/stable/source/src/libs/libpng/libpng-src/scripts/pnglibconf.dfa
    branches/stable/source/src/libs/libpng/libpng-src/scripts/pnglibconf.h.prebuilt
    branches/stable/source/src/libs/libpng/libpng-src/scripts/symbols.def
    branches/stable/source/src/libs/libpng/libpng-src/tests/pngtest
    branches/stable/source/src/libs/libpng/libpng-src/tests/pngunknown-sAPI
    branches/stable/source/src/libs/libpng/version.ac
    branches/stable/source/src/libs/poppler/Makefile.in
    branches/stable/source/src/libs/poppler/aclocal.m4
    branches/stable/source/src/libs/poppler/include/Makefile.in
    branches/stable/source/src/libs/poppler/include/fofi/Makefile.in
    branches/stable/source/src/libs/poppler/include/goo/Makefile.in
    branches/stable/source/src/libs/xpdf/ChangeLog
    branches/stable/source/src/libs/xpdf/Makefile.am
    branches/stable/source/src/libs/xpdf/Makefile.in
    branches/stable/source/src/libs/xpdf/TLpatches/ChangeLog
    branches/stable/source/src/libs/xpdf/TLpatches/TL-Changes
    branches/stable/source/src/libs/xpdf/aclocal.m4
    branches/stable/source/src/libs/xpdf/configure
    branches/stable/source/src/libs/xpdf/fofi/Makefile.in
    branches/stable/source/src/libs/xpdf/goo/Makefile.in
    branches/stable/source/src/libs/xpdf/splash/Makefile.in
    branches/stable/source/src/libs/xpdf/version.ac
    branches/stable/source/src/libs/xpdf/xpdf/Makefile.in
    branches/stable/source/src/libs/xpdf/xpdf-src/ANNOUNCE
    branches/stable/source/src/libs/xpdf/xpdf-src/CHANGES
    branches/stable/source/src/libs/xpdf/xpdf-src/INSTALL
    branches/stable/source/src/libs/xpdf/xpdf-src/README
    branches/stable/source/src/libs/xpdf/xpdf-src/aconf2.h
    branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdfdetach.1
    branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdfdetach.cat
    branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdffonts.1
    branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdffonts.cat
    branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdfimages.1
    branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdfimages.cat
    branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdfinfo.1
    branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdfinfo.cat
    branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdftohtml.1
    branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdftohtml.cat
    branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdftopng.1
    branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdftopng.cat
    branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdftoppm.1
    branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdftoppm.cat
    branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdftops.1
    branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdftops.cat
    branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdftotext.1
    branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdftotext.cat
    branches/stable/source/src/libs/xpdf/xpdf-src/doc/sample-xpdfrc
    branches/stable/source/src/libs/xpdf/xpdf-src/doc/xpdf.1
    branches/stable/source/src/libs/xpdf/xpdf-src/doc/xpdf.cat
    branches/stable/source/src/libs/xpdf/xpdf-src/doc/xpdfrc.5
    branches/stable/source/src/libs/xpdf/xpdf-src/doc/xpdfrc.cat
    branches/stable/source/src/libs/xpdf/xpdf-src/fofi/FoFiBase.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/fofi/FoFiEncodings.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/fofi/FoFiIdentifier.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/fofi/FoFiTrueType.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/fofi/FoFiTrueType.h
    branches/stable/source/src/libs/xpdf/xpdf-src/fofi/FoFiType1.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/fofi/FoFiType1C.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/fofi/FoFiType1C.h
    branches/stable/source/src/libs/xpdf/xpdf-src/goo/FixedPoint.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/goo/FixedPoint.h
    branches/stable/source/src/libs/xpdf/xpdf-src/goo/GHash.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/goo/GList.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/goo/GMutex.h
    branches/stable/source/src/libs/xpdf/xpdf-src/goo/GString.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/goo/gfile.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/goo/gfile.h
    branches/stable/source/src/libs/xpdf/xpdf-src/goo/gmem.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/goo/gmem.h
    branches/stable/source/src/libs/xpdf/xpdf-src/goo/gmempp.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/goo/parseargs.c
    branches/stable/source/src/libs/xpdf/xpdf-src/splash/Splash.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/splash/Splash.h
    branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashBitmap.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashClip.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashClip.h
    branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashFTFont.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashFTFont.h
    branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashFTFontEngine.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashFTFontEngine.h
    branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashFTFontFile.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashFTFontFile.h
    branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashFont.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashFont.h
    branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashFontEngine.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashFontEngine.h
    branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashFontFile.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashFontFile.h
    branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashFontFileID.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashMath.h
    branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashPath.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashPath.h
    branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashPattern.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashScreen.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashScreen.h
    branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashState.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashState.h
    branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashTypes.h
    branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashXPath.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashXPath.h
    branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashXPathScanner.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashXPathScanner.h
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/AcroForm.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/AcroForm.h
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/Annot.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/Annot.h
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/Array.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/Array.h
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/BuiltinFont.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/BuiltinFontTables.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/CMap.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/CMap.h
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/Catalog.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/Catalog.h
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/CharCodeToUnicode.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/CharCodeToUnicode.h
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/Decrypt.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/Decrypt.h
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/Dict.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/Dict.h
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/Error.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/Error.h
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/FontEncodingTables.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/Form.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/Form.h
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/Function.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/Gfx.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/Gfx.h
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/GfxFont.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/GfxFont.h
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/GfxState.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/GfxState.h
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/GlobalParams.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/GlobalParams.h
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/HTMLGen.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/HTMLGen.h
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/ImageOutputDev.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/ImageOutputDev.h
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/JArithmeticDecoder.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/JBIG2Stream.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/JBIG2Stream.h
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/JPXStream.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/JPXStream.h
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/Lexer.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/Lexer.h
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/Link.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/NameToCharCode.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/Object.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/Object.h
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/OptionalContent.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/OptionalContent.h
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/Outline.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/Outline.h
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/OutputDev.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/OutputDev.h
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/PDFCore.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/PDFCore.h
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/PDFDoc.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/PDFDoc.h
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/PDFDocEncoding.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/PSOutputDev.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/PSOutputDev.h
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/PSTokenizer.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/Page.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/Page.h
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/Parser.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/Parser.h
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/PreScanOutputDev.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/PreScanOutputDev.h
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/SecurityHandler.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/SecurityHandler.h
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/SplashOutputDev.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/SplashOutputDev.h
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/Stream.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/Stream.h
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/TextOutputDev.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/TextOutputDev.h
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/TextString.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/TextString.h
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/UTF8.h
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/UnicodeMap.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/UnicodeMap.h
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/UnicodeMapTables.h
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/UnicodeTypeTable.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/XFAForm.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/XFAForm.h
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/XRef.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/XRef.h
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/Zoox.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/Zoox.h
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/config.h
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/pdfdetach.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/pdffonts.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/pdfimages.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/pdfinfo.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/pdftohtml.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/pdftopng.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/pdftoppm.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/pdftops.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/pdftotext.cc
    branches/stable/source/src/libs/zlib/Makefile.in
    branches/stable/source/src/libs/zlib/aclocal.m4
    branches/stable/source/src/libs/zlib/include/Makefile.in
    branches/stable/source/src/tardate.ac
    branches/stable/source/src/texk/Makefile.in
    branches/stable/source/src/texk/aclocal.m4
    branches/stable/source/src/texk/configure
    branches/stable/source/src/texk/kpathsea/ChangeLog
    branches/stable/source/src/texk/kpathsea/Makefile.in
    branches/stable/source/src/texk/kpathsea/aclocal.m4
    branches/stable/source/src/texk/kpathsea/c-auto.in
    branches/stable/source/src/texk/kpathsea/configure
    branches/stable/source/src/texk/kpathsea/db.c
    branches/stable/source/src/texk/kpathsea/doc/Makefile.in
    branches/stable/source/src/texk/kpathsea/doc/kpathsea.info
    branches/stable/source/src/texk/kpathsea/doc/kpathsea.texi
    branches/stable/source/src/texk/kpathsea/elt-dirs.c
    branches/stable/source/src/texk/kpathsea/expand.c
    branches/stable/source/src/texk/kpathsea/man/Makefile.in
    branches/stable/source/src/texk/kpathsea/mingw32.c
    branches/stable/source/src/texk/kpathsea/tex-file.c
    branches/stable/source/src/texk/kpathsea/version.ac
    branches/stable/source/src/texk/kpathsea/win32/ChangeLog
    branches/stable/source/src/texk/kpathsea/win32/Makefile.in
    branches/stable/source/src/texk/kpathsea/win32/mktexfmt.c
    branches/stable/source/src/texk/kpathsea/win32lib.c
    branches/stable/source/src/texk/tests/TeXLive/TLUtils.pm
    branches/stable/source/src/texk/web2c/ChangeLog
    branches/stable/source/src/texk/web2c/Makefile.in
    branches/stable/source/src/texk/web2c/NEWS
    branches/stable/source/src/texk/web2c/aclocal.m4
    branches/stable/source/src/texk/web2c/configure
    branches/stable/source/src/texk/web2c/cwebdir/cwebmac.tex
    branches/stable/source/src/texk/web2c/doc/Makefile.in
    branches/stable/source/src/texk/web2c/lib/ChangeLog
    branches/stable/source/src/texk/web2c/lib/Makefile.in
    branches/stable/source/src/texk/web2c/lib/openclose.c
    branches/stable/source/src/texk/web2c/lib/texmfmp.c
    branches/stable/source/src/texk/web2c/man/Makefile.in
    branches/stable/source/src/texk/web2c/omegafonts/Makefile.in
    branches/stable/source/src/texk/web2c/otps/Makefile.in
    branches/stable/source/src/texk/web2c/otps/win32/Makefile.in
    branches/stable/source/src/texk/web2c/pdftexdir/ChangeLog
    branches/stable/source/src/texk/web2c/pdftexdir/NEWS
    branches/stable/source/src/texk/web2c/pdftexdir/pdftex.web
    branches/stable/source/src/texk/web2c/pdftexdir/pdftosrc.cc
    branches/stable/source/src/texk/web2c/synctexdir/ChangeLog
    branches/stable/source/src/texk/web2c/synctexdir/synctex_main.c
    branches/stable/source/src/texk/web2c/synctexdir/synctex_parser.c
    branches/stable/source/src/texk/web2c/synctexdir/synctex_parser.h
    branches/stable/source/src/texk/web2c/synctexdir/synctex_parser_local.h
    branches/stable/source/src/texk/web2c/synctexdir/synctex_parser_readme.txt
    branches/stable/source/src/texk/web2c/synctexdir/synctex_parser_utils.c
    branches/stable/source/src/texk/web2c/synctexdir/synctex_parser_utils.h
    branches/stable/source/src/texk/web2c/synctexdir/synctex_parser_version.txt
    branches/stable/source/src/texk/web2c/web2c/Makefile.in
    branches/stable/source/src/texk/web2c/web2c/aclocal.m4
    branches/stable/source/src/texk/web2c/web2c/configure
    branches/stable/source/src/texk/web2c/window/Makefile.in
    branches/stable/source/src/utils/Makefile.in
    branches/stable/source/src/utils/README
    branches/stable/source/src/utils/aclocal.m4
    branches/stable/source/src/utils/configure
    branches/stable/source/src/version.ac
    branches/stable/source/sync-pdftex.sh

Added Paths:
-----------
    branches/stable/source/src/libs/libpng/libpng-src/contrib/oss-fuzz/
    branches/stable/source/src/libs/libpng/libpng-src/contrib/oss-fuzz/Dockerfile
    branches/stable/source/src/libs/libpng/libpng-src/contrib/oss-fuzz/README.txt
    branches/stable/source/src/libs/libpng/libpng-src/contrib/oss-fuzz/build.sh
    branches/stable/source/src/libs/libpng/libpng-src/contrib/oss-fuzz/libpng_read_fuzzer.cc
    branches/stable/source/src/libs/libpng/libpng-src/contrib/oss-fuzz/libpng_read_fuzzer.options
    branches/stable/source/src/libs/libpng/libpng-src/contrib/oss-fuzz/newcc
    branches/stable/source/src/libs/libpng/libpng-src/contrib/oss-fuzz/png.dict
    branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/
    branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/bad_iCCP.png
    branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/badadler.png
    branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/badcrc.png
    branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/empty_ancillary_chunks.png
    branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_IDAT.png
    branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_bKGD_chunk.png
    branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_cHRM_chunk.png
    branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_eXIf_chunk.png
    branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_gAMA_chunk.png
    branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_hIST_chunk.png
    branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_iCCP_chunk.png
    branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_iTXt_chunk.png
    branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_juNK_unsafe_to_copy.png
    branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_juNk_safe_to_copy.png
    branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_pCAL_chunk.png
    branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_pHYs_chunk.png
    branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_sCAL_chunk.png
    branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_sPLT_chunk.png
    branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_sRGB_chunk.png
    branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_sTER_chunk.png
    branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_tEXt_chunk.png
    branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_tIME_chunk.png
    branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_zTXt_chunk.png
    branches/stable/source/src/libs/libpng/libpng-src/scripts/makefile.linux-opt
    branches/stable/source/src/libs/libpng/libpng-src/tests/pngtest-badpngs
    branches/stable/source/src/libs/xpdf/TLpatches/patch-bunched
    branches/stable/source/src/libs/xpdf/xpdf-src/CMakeLists.txt
    branches/stable/source/src/libs/xpdf/xpdf-src/cmake-config.txt
    branches/stable/source/src/libs/xpdf/xpdf-src/fofi/CMakeLists.txt
    branches/stable/source/src/libs/xpdf/xpdf-src/goo/CMakeLists.txt
    branches/stable/source/src/libs/xpdf/xpdf-src/goo/gmempp.h
    branches/stable/source/src/libs/xpdf/xpdf-src/splash/CMakeLists.txt
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/CMakeLists.txt
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/DisplayState.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/DisplayState.h
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/TileCache.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/TileCache.h
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/TileCompositor.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/TileCompositor.h
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/TileMap.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/TileMap.h
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/UTF8.cc
    branches/stable/source/src/texk/web2c/pdftexdir/pdftoepdf-newpoppler.cc
    branches/stable/source/src/texk/web2c/pdftexdir/pdftosrc-newpoppler.cc
    branches/stable/source/src/texk/web2c/synctexdir/synctex_parser_advanced.h
    branches/stable/source/src/texk/web2c/synctexdir/synctex_parser_readme.md
    branches/stable/source/src/texk/web2c/synctexdir/synctex_version.h

Removed Paths:
-------------
    branches/stable/source/src/libs/libpng/libpng-src/tests/badadler.png
    branches/stable/source/src/libs/libpng/libpng-src/tests/badcrc.png
    branches/stable/source/src/libs/xpdf/TLpatches/patch-10-exclude-body-of-Page_getDefaultCTM
    branches/stable/source/src/libs/xpdf/TLpatches/patch-20-skip-reading-config-file
    branches/stable/source/src/libs/xpdf/TLpatches/patch-22-exclude-openTempFile
    branches/stable/source/src/libs/xpdf/TLpatches/patch-30-include-strings_h
    branches/stable/source/src/libs/xpdf/TLpatches/patch-40-W32TeX
    branches/stable/source/src/libs/xpdf/TLpatches/patch-41-W32TeX
    branches/stable/source/src/libs/xpdf/xpdf-foolabs/
    branches/stable/source/src/libs/xpdf/xpdf-src/Makefile.in
    branches/stable/source/src/libs/xpdf/xpdf-src/aclocal.m4
    branches/stable/source/src/libs/xpdf/xpdf-src/aconf-dj.h
    branches/stable/source/src/libs/xpdf/xpdf-src/aconf-win32.h
    branches/stable/source/src/libs/xpdf/xpdf-src/aconf.h.in
    branches/stable/source/src/libs/xpdf/xpdf-src/configure
    branches/stable/source/src/libs/xpdf/xpdf-src/configure.in
    branches/stable/source/src/libs/xpdf/xpdf-src/dj_make.bat
    branches/stable/source/src/libs/xpdf/xpdf-src/fofi/Makefile.dep
    branches/stable/source/src/libs/xpdf/xpdf-src/fofi/Makefile.in
    branches/stable/source/src/libs/xpdf/xpdf-src/goo/Makefile.dep
    branches/stable/source/src/libs/xpdf/xpdf-src/goo/Makefile.in
    branches/stable/source/src/libs/xpdf/xpdf-src/misc/
    branches/stable/source/src/libs/xpdf/xpdf-src/ms_make.bat
    branches/stable/source/src/libs/xpdf/xpdf-src/splash/Makefile.dep
    branches/stable/source/src/libs/xpdf/xpdf-src/splash/Makefile.in
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/CoreOutputDev.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/CoreOutputDev.h
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/Makefile.dep
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/Makefile.in
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/XPDFApp.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/XPDFApp.h
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/XPDFCore.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/XPDFCore.h
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/XPDFTree.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/XPDFTree.h
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/XPDFTreeP.h
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/XPDFViewer.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/XPDFViewer.h
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/XpdfPluginAPI.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/XpdfPluginAPI.h
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/about-text.h
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/about.xbm
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/backArrow.xbm
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/backArrowDis.xbm
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/dblLeftArrow.xbm
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/dblLeftArrowDis.xbm
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/dblRightArrow.xbm
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/dblRightArrowDis.xbm
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/find.xbm
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/findDis.xbm
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/forwardArrow.xbm
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/forwardArrowDis.xbm
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/leftArrow.xbm
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/leftArrowDis.xbm
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/print.xbm
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/printDis.xbm
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/rightArrow.xbm
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/rightArrowDis.xbm
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/xpdf.cc
    branches/stable/source/src/libs/xpdf/xpdf-src/xpdf/xpdfIcon.xpm

Modified: branches/stable/source/src/Makefile.in
===================================================================
--- branches/stable/source/src/Makefile.in	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/Makefile.in	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.15.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2017 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -493,7 +493,7 @@
 recurse_this = 
 recurse_top = 
 
-# $Id: recurse.am 43261 2017-02-17 22:37:44Z karl $
+# $Id: Makefile.in 44682 2017-06-24 21:21:08Z karl $
 #
 # Requires $(recurse_this) and $(recurse_top).
 # Uses CONF_SUBDIRS and MAKE_SUBDIRS (set by kpse-setup.m4).
@@ -739,7 +739,7 @@
 	  ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
 	|| chmod -R a+r "$(distdir)"
 dist-gzip: distdir
-	tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+	tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz
 	$(am__post_remove_distdir)
 
 dist-bzip2: distdir
@@ -764,7 +764,7 @@
 	@echo WARNING: "Support for shar distribution archives is" \
 	               "deprecated." >&2
 	@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
-	shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
+	shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz
 	$(am__post_remove_distdir)
 
 dist-zip: distdir
@@ -782,7 +782,7 @@
 distcheck: dist
 	case '$(DIST_ARCHIVES)' in \
 	*.tar.gz*) \
-	  GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
+	  eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\
 	*.tar.bz2*) \
 	  bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
 	*.tar.lz*) \
@@ -792,7 +792,7 @@
 	*.tar.Z*) \
 	  uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
 	*.shar.gz*) \
-	  GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
+	  eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\
 	*.zip*) \
 	  unzip $(distdir).zip ;;\
 	esac

Modified: branches/stable/source/src/aclocal.m4
===================================================================
--- branches/stable/source/src/aclocal.m4	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/aclocal.m4	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,6 +1,6 @@
-# generated automatically by aclocal 1.15 -*- Autoconf -*-
+# generated automatically by aclocal 1.15.1 -*- Autoconf -*-
 
-# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+# Copyright (C) 1996-2017 Free Software Foundation, Inc.
 
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -20,7 +20,7 @@
 If you have problems, you may need to regenerate the build system entirely.
 To do so, use the procedure documented by the package, typically 'autoreconf'.])])
 
-# Copyright (C) 2002-2014 Free Software Foundation, Inc.
+# Copyright (C) 2002-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -35,7 +35,7 @@
 [am__api_version='1.15'
 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
 dnl require some minimum version.  Point them to the right macro.
-m4_if([$1], [1.15], [],
+m4_if([$1], [1.15.1], [],
       [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
 ])
 
@@ -51,7 +51,7 @@
 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.15])dnl
+[AM_AUTOMAKE_VERSION([1.15.1])dnl
 m4_ifndef([AC_AUTOCONF_VERSION],
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
@@ -58,7 +58,7 @@
 
 # AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
 
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -110,7 +110,7 @@
 
 # AM_CONDITIONAL                                            -*- Autoconf -*-
 
-# Copyright (C) 1997-2014 Free Software Foundation, Inc.
+# Copyright (C) 1997-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -141,7 +141,7 @@
 Usually this means the macro was only invoked conditionally.]])
 fi])])
 
-# Copyright (C) 1999-2014 Free Software Foundation, Inc.
+# Copyright (C) 1999-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -332,7 +332,7 @@
 
 # Generate code to set up dependency tracking.              -*- Autoconf -*-
 
-# Copyright (C) 1999-2014 Free Software Foundation, Inc.
+# Copyright (C) 1999-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -408,7 +408,7 @@
 
 # Do all the work for Automake.                             -*- Autoconf -*-
 
-# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+# Copyright (C) 1996-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -605,7 +605,7 @@
 done
 echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
 
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -626,7 +626,7 @@
 fi
 AC_SUBST([install_sh])])
 
-# Copyright (C) 2003-2014 Free Software Foundation, Inc.
+# Copyright (C) 2003-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -648,7 +648,7 @@
 # Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
 # From Jim Meyering
 
-# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+# Copyright (C) 1996-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -683,7 +683,7 @@
 
 # Check to see how 'make' treats includes.	            -*- Autoconf -*-
 
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -733,7 +733,7 @@
 
 # Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
 
-# Copyright (C) 1997-2014 Free Software Foundation, Inc.
+# Copyright (C) 1997-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -772,7 +772,7 @@
 
 # Helper functions for option handling.                     -*- Autoconf -*-
 
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -801,7 +801,7 @@
 AC_DEFUN([_AM_IF_OPTION],
 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
 
-# Copyright (C) 1999-2014 Free Software Foundation, Inc.
+# Copyright (C) 1999-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -848,7 +848,7 @@
 # For backward compatibility.
 AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
 
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -867,7 +867,7 @@
 
 # Check to make sure that the build environment is sane.    -*- Autoconf -*-
 
-# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+# Copyright (C) 1996-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -948,7 +948,7 @@
 rm -f conftest.file
 ])
 
-# Copyright (C) 2009-2014 Free Software Foundation, Inc.
+# Copyright (C) 2009-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1008,7 +1008,7 @@
 _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
 ])
 
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1036,7 +1036,7 @@
 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
 AC_SUBST([INSTALL_STRIP_PROGRAM])])
 
-# Copyright (C) 2006-2014 Free Software Foundation, Inc.
+# Copyright (C) 2006-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1055,7 +1055,7 @@
 
 # Check how to create a tarball.                            -*- Autoconf -*-
 
-# Copyright (C) 2004-2014 Free Software Foundation, Inc.
+# Copyright (C) 2004-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,

Modified: branches/stable/source/src/auxdir/auxsub/Makefile.in
===================================================================
--- branches/stable/source/src/auxdir/auxsub/Makefile.in	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/auxdir/auxsub/Makefile.in	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.15.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2017 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -300,7 +300,7 @@
 	  ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
 	|| chmod -R a+r "$(distdir)"
 dist-gzip: distdir
-	tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+	tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz
 	$(am__post_remove_distdir)
 
 dist-bzip2: distdir
@@ -326,7 +326,7 @@
 	@echo WARNING: "Support for shar distribution archives is" \
 	               "deprecated." >&2
 	@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
-	shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
+	shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz
 	$(am__post_remove_distdir)
 
 dist-zip: distdir
@@ -344,7 +344,7 @@
 distcheck: dist
 	case '$(DIST_ARCHIVES)' in \
 	*.tar.gz*) \
-	  GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
+	  eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\
 	*.tar.bz2*) \
 	  bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
 	*.tar.lz*) \
@@ -354,7 +354,7 @@
 	*.tar.Z*) \
 	  uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
 	*.shar.gz*) \
-	  GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
+	  eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\
 	*.zip*) \
 	  unzip $(distdir).zip ;;\
 	esac

Modified: branches/stable/source/src/auxdir/auxsub/aclocal.m4
===================================================================
--- branches/stable/source/src/auxdir/auxsub/aclocal.m4	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/auxdir/auxsub/aclocal.m4	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,6 +1,6 @@
-# generated automatically by aclocal 1.15 -*- Autoconf -*-
+# generated automatically by aclocal 1.15.1 -*- Autoconf -*-
 
-# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+# Copyright (C) 1996-2017 Free Software Foundation, Inc.
 
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -20,7 +20,7 @@
 If you have problems, you may need to regenerate the build system entirely.
 To do so, use the procedure documented by the package, typically 'autoreconf'.])])
 
-# Copyright (C) 2002-2014 Free Software Foundation, Inc.
+# Copyright (C) 2002-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -35,7 +35,7 @@
 [am__api_version='1.15'
 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
 dnl require some minimum version.  Point them to the right macro.
-m4_if([$1], [1.15], [],
+m4_if([$1], [1.15.1], [],
       [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
 ])
 
@@ -51,7 +51,7 @@
 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.15])dnl
+[AM_AUTOMAKE_VERSION([1.15.1])dnl
 m4_ifndef([AC_AUTOCONF_VERSION],
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
@@ -58,7 +58,7 @@
 
 # AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
 
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -110,7 +110,7 @@
 
 # AM_CONDITIONAL                                            -*- Autoconf -*-
 
-# Copyright (C) 1997-2014 Free Software Foundation, Inc.
+# Copyright (C) 1997-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -143,7 +143,7 @@
 
 # Do all the work for Automake.                             -*- Autoconf -*-
 
-# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+# Copyright (C) 1996-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -340,7 +340,7 @@
 done
 echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
 
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -361,7 +361,7 @@
 fi
 AC_SUBST([install_sh])])
 
-# Copyright (C) 2003-2014 Free Software Foundation, Inc.
+# Copyright (C) 2003-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -383,7 +383,7 @@
 # Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
 # From Jim Meyering
 
-# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+# Copyright (C) 1996-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -418,7 +418,7 @@
 
 # Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
 
-# Copyright (C) 1997-2014 Free Software Foundation, Inc.
+# Copyright (C) 1997-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -457,7 +457,7 @@
 
 # Helper functions for option handling.                     -*- Autoconf -*-
 
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -488,7 +488,7 @@
 
 # Check to make sure that the build environment is sane.    -*- Autoconf -*-
 
-# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+# Copyright (C) 1996-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -569,7 +569,7 @@
 rm -f conftest.file
 ])
 
-# Copyright (C) 2009-2014 Free Software Foundation, Inc.
+# Copyright (C) 2009-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -629,7 +629,7 @@
 _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
 ])
 
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -657,7 +657,7 @@
 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
 AC_SUBST([INSTALL_STRIP_PROGRAM])])
 
-# Copyright (C) 2006-2014 Free Software Foundation, Inc.
+# Copyright (C) 2006-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -676,7 +676,7 @@
 
 # Check how to create a tarball.                            -*- Autoconf -*-
 
-# Copyright (C) 2004-2014 Free Software Foundation, Inc.
+# Copyright (C) 2004-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,

Modified: branches/stable/source/src/build-aux/ar-lib
===================================================================
--- branches/stable/source/src/build-aux/ar-lib	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/build-aux/ar-lib	2017-11-01 18:15:56 UTC (rev 780)
@@ -18,7 +18,7 @@
 # GNU General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+# along with this program.  If not, see <https://www.gnu.org/licenses/>.
 
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a

Modified: branches/stable/source/src/build-aux/compile
===================================================================
--- branches/stable/source/src/build-aux/compile	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/build-aux/compile	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,7 +1,7 @@
 #! /bin/sh
 # Wrapper for compilers which do not understand '-c -o'.
 
-scriptversion=2016-01-11.22; # UTC
+scriptversion=2017-09-16.17; # UTC
 
 # Copyright (C) 1999-2017 Free Software Foundation, Inc.
 # Written by Tom Tromey <tromey at cygnus.com>.
@@ -17,7 +17,7 @@
 # GNU General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+# along with this program.  If not, see <https://www.gnu.org/licenses/>.
 
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a

Modified: branches/stable/source/src/build-aux/config.guess
===================================================================
--- branches/stable/source/src/build-aux/config.guess	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/build-aux/config.guess	2017-11-01 18:15:56 UTC (rev 780)
@@ -2,7 +2,7 @@
 # Attempt to guess a canonical system name.
 #   Copyright 1992-2017 Free Software Foundation, Inc.
 
-timestamp='2017-05-11'
+timestamp='2017-09-26'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -15,7 +15,7 @@
 # General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with this program; if not, see <http://www.gnu.org/licenses/>.
+# along with this program; if not, see <https://www.gnu.org/licenses/>.
 #
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
@@ -27,7 +27,7 @@
 # Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
 #
 # You can get the latest version of this script from:
-# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
+# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
 #
 # Please send patches to <config-patches at gnu.org>.
 
@@ -259,6 +259,9 @@
     *:Sortix:*:*)
 	echo ${UNAME_MACHINE}-unknown-sortix
 	exit ;;
+    *:Redox:*:*)
+	echo ${UNAME_MACHINE}-unknown-redox
+	exit ;;
     alpha:OSF1:*:*)
 	case $UNAME_RELEASE in
 	*4.0)
@@ -315,15 +318,6 @@
 	exitcode=$?
 	trap '' 0
 	exit $exitcode ;;
-    Alpha\ *:Windows_NT*:*)
-	# How do we know it's Interix rather than the generic POSIX subsystem?
-	# Should we change UNAME_MACHINE based on the output of uname instead
-	# of the specific Alpha model?
-	echo alpha-pc-interix
-	exit ;;
-    21064:Windows_NT:50:3)
-	echo alpha-dec-winnt3.5
-	exit ;;
     Amiga*:UNIX_System_V:4.0:*)
 	echo m68k-unknown-sysv4
 	exit ;;
@@ -855,10 +849,6 @@
     *:MSYS*:*)
 	echo ${UNAME_MACHINE}-pc-msys
 	exit ;;
-    i*:windows32*:*)
-	# uname -m includes "-pc" on this system.
-	echo ${UNAME_MACHINE}-mingw32
-	exit ;;
     i*:PW*:*)
 	echo ${UNAME_MACHINE}-pc-pw32
 	exit ;;
@@ -874,18 +864,6 @@
 		echo ia64-unknown-interix${UNAME_RELEASE}
 		exit ;;
 	esac ;;
-    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
-	echo i${UNAME_MACHINE}-pc-mks
-	exit ;;
-    8664:Windows_NT:*)
-	echo x86_64-pc-mks
-	exit ;;
-    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
-	# How do we know it's Interix rather than the generic POSIX subsystem?
-	# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
-	# UNAME_MACHINE based on the output of uname instead of i386?
-	echo i586-pc-interix
-	exit ;;
     i*:UWIN*:*)
 	echo ${UNAME_MACHINE}-pc-uwin
 	exit ;;
@@ -892,9 +870,6 @@
     amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
 	echo x86_64-unknown-cygwin
 	exit ;;
-    p*:CYGWIN*:*)
-	echo powerpcle-unknown-cygwin
-	exit ;;
     prep*:SunOS:5.*:*)
 	echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
 	exit ;;
@@ -1304,8 +1279,8 @@
 	if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then
 	    if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
 		if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
-		    (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
-		    grep IS_64BIT_ARCH >/dev/null
+		       (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
+		       grep IS_64BIT_ARCH >/dev/null
 		then
 		    case $UNAME_PROCESSOR in
 			i386) UNAME_PROCESSOR=x86_64 ;;
@@ -1312,6 +1287,13 @@
 			powerpc) UNAME_PROCESSOR=powerpc64 ;;
 		    esac
 		fi
+		# On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc
+		if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \
+		       (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
+		       grep IS_PPC >/dev/null
+		then
+		    UNAME_PROCESSOR=powerpc
+		fi
 	    fi
 	elif test "$UNAME_PROCESSOR" = i386 ; then
 	    # Avoid executing cc on OS X 10.9, as it ships with a stub
@@ -1418,16 +1400,28 @@
 	exit ;;
 esac
 
+echo "$0: unable to guess system type" >&2
+
+case "${UNAME_MACHINE}:${UNAME_SYSTEM}" in
+    mips:Linux | mips64:Linux)
+	# If we got here on MIPS GNU/Linux, output extra information.
+	cat >&2 <<EOF
+
+NOTE: MIPS GNU/Linux systems require a C compiler to fully recognize
+the system type. Please install a C compiler and try again.
+EOF
+	;;
+esac
+
 cat >&2 <<EOF
-$0: unable to guess system type
 
 This script (version $timestamp), has failed to recognize the
-operating system you are using. If your script is old, overwrite
-config.guess and config.sub with the latest versions from:
+operating system you are using. If your script is old, overwrite *all*
+copies of config.guess and config.sub with the latest versions from:
 
-  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
+  https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
 and
-  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
+  https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
 
 If $0 has already been updated, send the following data and any
 information you think might be pertinent to config-patches at gnu.org to
@@ -1459,7 +1453,7 @@
 exit 1
 
 # Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'write-file-functions 'time-stamp)
 # time-stamp-start: "timestamp='"
 # time-stamp-format: "%:y-%02m-%02d"
 # time-stamp-end: "'"

Modified: branches/stable/source/src/build-aux/config.sub
===================================================================
--- branches/stable/source/src/build-aux/config.sub	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/build-aux/config.sub	2017-11-01 18:15:56 UTC (rev 780)
@@ -2,7 +2,7 @@
 # Configuration validation subroutine script.
 #   Copyright 1992-2017 Free Software Foundation, Inc.
 
-timestamp='2017-04-02'
+timestamp='2017-09-26'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -15,7 +15,7 @@
 # General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with this program; if not, see <http://www.gnu.org/licenses/>.
+# along with this program; if not, see <https://www.gnu.org/licenses/>.
 #
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
@@ -33,7 +33,7 @@
 # Otherwise, we print the canonical config type on stdout and succeed.
 
 # You can get the latest version of this script from:
-# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
+# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
 
 # This file is supposed to be the same for all GNU packages
 # and recognize all the CPU types, system types and aliases
@@ -229,9 +229,6 @@
 	-ptx*)
 		basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
 		;;
-	-windowsnt*)
-		os=`echo $os | sed -e 's/windowsnt/winnt/'`
-		;;
 	-psos*)
 		os=-psos
 		;;
@@ -1259,6 +1256,9 @@
 		basic_machine=hppa1.1-winbond
 		os=-proelf
 		;;
+	x64)
+		basic_machine=x86_64-pc
+		;;
 	xbox)
 		basic_machine=i686-pc
 		os=-mingw32
@@ -1366,8 +1366,8 @@
 if [ x"$os" != x"" ]
 then
 case $os in
-	# First match some system type aliases
-	# that might get confused with valid system types.
+	# First match some system type aliases that might get confused
+	# with valid system types.
 	# -solaris* is a basic system type, with this one exception.
 	-auroraux)
 		os=-auroraux
@@ -1387,9 +1387,9 @@
 	-gnu/linux*)
 		os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
 		;;
-	# First accept the basic system types.
+	# Now accept the basic system types.
 	# The portable systems comes first.
-	# Each alternative MUST END IN A *, to match a version number.
+	# Each alternative MUST end in a * to match a version number.
 	# -sysv* is not here because it comes later, after sysvr4.
 	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
 	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
@@ -1829,7 +1829,7 @@
 exit
 
 # Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'write-file-functions 'time-stamp)
 # time-stamp-start: "timestamp='"
 # time-stamp-format: "%:y-%02m-%02d"
 # time-stamp-end: "'"

Modified: branches/stable/source/src/build-aux/depcomp
===================================================================
--- branches/stable/source/src/build-aux/depcomp	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/build-aux/depcomp	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,7 +1,7 @@
 #! /bin/sh
 # depcomp - compile a program generating dependencies as side-effects
 
-scriptversion=2016-01-11.22; # UTC
+scriptversion=2017-09-16.17; # UTC
 
 # Copyright (C) 1999-2017 Free Software Foundation, Inc.
 
@@ -16,7 +16,7 @@
 # GNU General Public License for more details.
 
 # You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+# along with this program.  If not, see <https://www.gnu.org/licenses/>.
 
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
@@ -251,6 +251,41 @@
   exit 1
   ;;
 
+sgi)
+  if test "$libtool" = yes; then
+    "$@" "-Wp,-MDupdate,$tmpdepfile"
+  else
+    "$@" -MDupdate "$tmpdepfile"
+  fi
+  stat=$?
+  if test $stat -ne 0; then
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  rm -f "$depfile"
+
+  if test -f "$tmpdepfile"; then  # yes, the sourcefile depend on other files
+    echo "$object : \\" > "$depfile"
+    # Clip off the initial element (the dependent).  Don't try to be
+    # clever and replace this with sed code, as IRIX sed won't handle
+    # lines with more than a fixed number of characters (4096 in
+    # IRIX 6.2 sed, 8192 in IRIX 6.5).  We also remove comment lines;
+    # the IRIX cc adds comments like '#:fec' to the end of the
+    # dependency line.
+    tr ' ' "$nl" < "$tmpdepfile" \
+      | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \
+      | tr "$nl" ' ' >> "$depfile"
+    echo >> "$depfile"
+    # The second pass generates a dummy entry for each header file.
+    tr ' ' "$nl" < "$tmpdepfile" \
+      | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
+      >> "$depfile"
+  else
+    make_dummy_depfile
+  fi
+  rm -f "$tmpdepfile"
+  ;;
+
 xlc)
   # This case exists only to let depend.m4 do its work.  It works by
   # looking at the text of this script.  This case will never be run,

Modified: branches/stable/source/src/build-aux/install-sh
===================================================================
--- branches/stable/source/src/build-aux/install-sh	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/build-aux/install-sh	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,7 +1,7 @@
 #!/bin/sh
 # install - install a program, script, or datafile
 
-scriptversion=2016-01-11.22; # UTC
+scriptversion=2017-09-23.17; # UTC
 
 # This originates from X11R5 (mit/util/scripts/install.sh), which was
 # later released in X11R6 (xc/config/util/install.sh) with the
@@ -271,8 +271,7 @@
     fi
     dst=$dst_arg
 
-    # If destination is a directory, append the input filename; won't work
-    # if double slashes aren't ignored.
+    # If destination is a directory, append the input filename.
     if test -d "$dst"; then
       if test "$is_target_a_directory" = never; then
         echo "$0: $dst_arg: Is a directory" >&2
@@ -279,7 +278,11 @@
         exit 1
       fi
       dstdir=$dst
-      dst=$dstdir/`basename "$src"`
+      dstbase=`basename "$src"`
+      case $dst in
+	*/) dst=$dst$dstbase;;
+	*)  dst=$dst/$dstbase;;
+      esac
       dstdir_status=0
     else
       dstdir=`dirname "$dst"`
@@ -288,6 +291,11 @@
     fi
   fi
 
+  case $dstdir in
+    */) dstdirslash=$dstdir;;
+    *)  dstdirslash=$dstdir/;;
+  esac
+
   obsolete_mkdir_used=false
 
   if test $dstdir_status != 0; then
@@ -427,8 +435,8 @@
   else
 
     # Make a couple of temp file names in the proper directory.
-    dsttmp=$dstdir/_inst.$$_
-    rmtmp=$dstdir/_rm.$$_
+    dsttmp=${dstdirslash}_inst.$$_
+    rmtmp=${dstdirslash}_rm.$$_
 
     # Trap to clean up those temp files at exit.
     trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0

Modified: branches/stable/source/src/build-aux/missing
===================================================================
--- branches/stable/source/src/build-aux/missing	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/build-aux/missing	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,9 +1,9 @@
 #! /bin/sh
 # Common wrapper for a few potentially missing GNU programs.
 
-scriptversion=2013-10-28.13; # UTC
+scriptversion=2016-01-11.22; # UTC
 
-# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+# Copyright (C) 1996-2017 Free Software Foundation, Inc.
 # Originally written by Fran,cois Pinard <pinard at iro.umontreal.ca>, 1996.
 
 # This program is free software; you can redistribute it and/or modify
@@ -210,6 +210,6 @@
 # eval: (add-hook 'write-file-hooks 'time-stamp)
 # time-stamp-start: "scriptversion="
 # time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
+# time-stamp-time-zone: "UTC0"
 # time-stamp-end: "; # UTC"
 # End:

Modified: branches/stable/source/src/build-aux/test-driver
===================================================================
--- branches/stable/source/src/build-aux/test-driver	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/build-aux/test-driver	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,9 +1,9 @@
 #! /bin/sh
 # test-driver - basic testsuite driver script.
 
-scriptversion=2013-07-13.22; # UTC
+scriptversion=2016-01-11.22; # UTC
 
-# Copyright (C) 2011-2014 Free Software Foundation, Inc.
+# Copyright (C) 2011-2017 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -143,6 +143,6 @@
 # eval: (add-hook 'write-file-hooks 'time-stamp)
 # time-stamp-start: "scriptversion="
 # time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
+# time-stamp-time-zone: "UTC0"
 # time-stamp-end: "; # UTC"
 # End:

Modified: branches/stable/source/src/build-aux/texinfo.tex
===================================================================
--- branches/stable/source/src/build-aux/texinfo.tex	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/build-aux/texinfo.tex	2017-11-01 18:15:56 UTC (rev 780)
@@ -3,7 +3,7 @@
 % Load plain if necessary, i.e., if running under initex.
 \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
 %
-\def\texinfoversion{2017-05-14.14}
+\def\texinfoversion{2017-09-16.10}
 %
 % Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
 % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
@@ -21,7 +21,7 @@
 % General Public License for more details.
 %
 % You should have received a copy of the GNU General Public License
-% along with this program.  If not, see <http://www.gnu.org/licenses/>.
+% along with this program.  If not, see <https://www.gnu.org/licenses/>.
 %
 % As a special exception, when this file is read by TeX when processing
 % a Texinfo source document, you may use the result without
@@ -30,9 +30,9 @@
 %
 % Please try the latest version of texinfo.tex before submitting bug
 % reports; you can get the latest version from:
-%   http://ftp.gnu.org/gnu/texinfo/ (the Texinfo release area), or
-%   http://ftpmirror.gnu.org/texinfo/ (same, via a mirror), or
-%   http://www.gnu.org/software/texinfo/ (the Texinfo home page)
+%   https://ftp.gnu.org/gnu/texinfo/ (the Texinfo release area), or
+%   https://ftpmirror.gnu.org/texinfo/ (same, via a mirror), or
+%   https://www.gnu.org/software/texinfo/ (the Texinfo home page)
 % The texinfo.tex in any given distribution could well be out
 % of date, so if that's what you're using, please check.
 %
@@ -56,7 +56,7 @@
 % extent.  You can get the existing language-specific files from the
 % full Texinfo distribution.
 %
-% The GNU Texinfo home page is http://www.gnu.org/software/texinfo.
+% The GNU Texinfo home page is https://www.gnu.org/software/texinfo.
 
 
 \message{Loading texinfo [version \texinfoversion]:}
@@ -5493,17 +5493,15 @@
       \let\indexlbrace\{   % Likewise, set these sequences for braces
       \let\indexrbrace\}   % used in the sort key.
       \begindoublecolumns
-      \let\entrywidowpenalty=\indexwidowpenalty
+      \let\dotheinsertentrybox\dotheinsertentryboxwithpenalty
       %
       % Read input from the index file line by line.
       \loopdo
-        \ifeof1
-          \let\firsttoken\relax
-        \else
+        \ifeof1 \else
           \read 1 to \nextline
-          \edef\act{\gdef\noexpand\firsttoken{\getfirsttoken\nextline}}%
-          \act
         \fi
+        %
+        \indexinputprocessing
         \thisline
         %
         \ifeof1\else
@@ -5515,12 +5513,20 @@
   \fi
   \closein 1
 \endgroup}
+\def\loopdo#1\repeat{\def\body{#1}\loopdoxxx}
+\def\loopdoxxx{\let\next=\relax\body\let\next=\loopdoxxx\fi\next}
 
+\def\indexinputprocessing{%
+  \ifeof1
+    \let\firsttoken\relax
+  \else
+    \edef\act{\gdef\noexpand\firsttoken{\getfirsttoken\nextline}}%
+    \act
+  \fi
+}
 \def\getfirsttoken#1{\expandafter\getfirsttokenx#1\endfirsttoken}
 \long\def\getfirsttokenx#1#2\endfirsttoken{\noexpand#1}
 
-\def\loopdo#1\repeat{\def\body{#1}\loopdoxxx}
-\def\loopdoxxx{\let\next=\relax\body\let\next=\loopdoxxx\fi\next}
 
 % These macros are used by the sorted index file itself.
 % Change them to control the appearance of the index.
@@ -5597,7 +5603,7 @@
     % For pdfTeX and XeTeX.
     % The redefinition of \domark stops marks being added in \pdflink to 
     % preserve coloured links across page boundaries.  Otherwise the marks
-    % would get in the way of \lastbox in \insertindexentrybox.
+    % would get in the way of \lastbox in \insertentrybox.
     \let\domark\relax
     %
     % Start a new paragraph if necessary, so our assignments below can't
@@ -5658,9 +5664,9 @@
     \fi
     \egroup % end \boxA
     \ifdim\wd\boxB = 0pt
-      \global\setbox\entryindexbox=\vbox{\unhbox\boxA}%
+      \global\setbox\entrybox=\vbox{\unhbox\boxA}%
     \else
-    \global\setbox\entryindexbox=\vbox\bgroup
+    \global\setbox\entrybox=\vbox\bgroup
       % We want the text of the entries to be aligned to the left, and the
       % page numbers to be aligned to the right.
       %
@@ -5690,10 +5696,13 @@
       \advance\dimen at ii by 1\dimen at i
       \ifdim\wd\boxA > \dimen at ii % If the entry doesn't fit in one line
       \ifdim\dimen@ > 0.8\dimen at ii   % due to long index text
-        \dimen@ = 0.7\dimen@ % Try to split the text roughly evenly
+        % Try to split the text roughly evenly.  \dimen@ will be the length of 
+        % the first line.
+        \dimen@ = 0.7\dimen@
         \dimen at ii = \hsize
         \ifnum\dimen@>\dimen at ii
-          % If the entry is too long, use the whole line
+          % If the entry is too long (for example, if it needs more than
+          % two lines), use all the space in the first line.
           \dimen@ = \dimen at ii
         \fi
         \advance\leftskip by 0pt plus 1fill % ragged right
@@ -5703,8 +5712,9 @@
         % instead of using \parshape with explicit line lengths, but TeX
         % doesn't seem to provide a way to do such a thing.
         %
-        \leftskip = 1em
-        \parindent = -1em
+        % Indent all lines but the first one.
+        \advance\leftskip by 1em
+        \advance\parindent by -1em
       \fi\fi
       \indent % start paragraph
       \unhbox\boxA
@@ -5722,19 +5732,20 @@
     \egroup % The \vbox
     \fi
   \endgroup
-  % delay text of entry until after penalty
-  \bgroup\aftergroup\insertindexentrybox
-  \entrywidowpenalty
+  \dotheinsertentrybox
 }}
 
 \newskip\thinshrinkable
 \skip\thinshrinkable=.15em minus .15em
 
-\newbox\entryindexbox
-\def\insertindexentrybox{%
-  \ourunvbox\entryindexbox
+\newbox\entrybox
+\def\insertentrybox{%
+  \ourunvbox\entrybox
 }
 
+% default definition
+\let\dotheinsertentrybox\insertentrybox
+
 % Use \lastbox to take apart vbox box by box, and add each sub-box
 % to the current vertical list.
 \def\ourunvbox#1{%
@@ -5757,21 +5768,18 @@
 \newbox\delayedbox
 \newbox\interbox
 
-% Default is no penalty
-\let\entrywidowpenalty\egroup
-
 % Used from \printindex.  \firsttoken should be the first token
 % after the \entry.  If it's not another \entry, we are at the last
 % line of a group of index entries, so insert a penalty to discourage
 % widowed index entries.
-\long\def\indexwidowpenalty{%
-  \def\isentry{\entry}%
+\def\dotheinsertentryboxwithpenalty{%
   \ifx\firsttoken\isentry
   \else
     \penalty 9000
   \fi
-  \egroup % now comes the box added with \aftergroup
+  \insertentrybox
 }
+\def\isentry{\entry}%
 
 % Like plain.tex's \dotfill, except uses up at least 1 em.
 % The filll stretch here overpowers both the fil and fill stretch to push
@@ -6939,7 +6947,15 @@
 % exist, with an empty box.  Let's hope all the numbers have the same width.
 % Also ignore the page number, which is conventionally not printed.
 \def\numeralbox{\setbox0=\hbox{8}\hbox to \wd0{\hfil}}
-\def\partentry#1#2#3#4{\dochapentry{\numeralbox\labelspace#1}{}}
+\def\partentry#1#2#3#4{%
+  % Add stretch and a bonus for breaking the page before the part heading.
+  % This reduces the chance of the page being broken immediately after the
+  % part heading, before a following chapter heading.
+  \vskip 0pt plus 5\baselineskip
+  \penalty-300
+  \vskip 0pt plus -5\baselineskip
+  \dochapentry{\numeralbox\labelspace#1}{}%
+}
 %
 % Parts, in the short toc.
 \def\shortpartentry#1#2#3#4{%
@@ -9430,7 +9446,7 @@
 \newif\ifwarnednoepsf
 \newhelp\noepsfhelp{epsf.tex must be installed for images to
   work.  It is also included in the Texinfo distribution, or you can get
-  it from ftp://tug.org/tex/epsf.tex.}
+  it from https://ctan.org/texarchive/macros/texinfo/texinfo/doc/epsf.tex.}
 %
 \def\image#1{%
   \ifx\epsfbox\thisisundefined
@@ -11005,7 +11021,6 @@
   \DeclareUnicodeCharacter{2113}{\ensuremath\ell}%
   \DeclareUnicodeCharacter{2118}{\ensuremath\wp}%
   \DeclareUnicodeCharacter{211C}{\ensuremath\Re}%
-  \DeclareUnicodeCharacter{2127}{\ensuremath\mho}%
   \DeclareUnicodeCharacter{2135}{\ensuremath\aleph}%
   \DeclareUnicodeCharacter{2190}{\ensuremath\leftarrow}%
   \DeclareUnicodeCharacter{2191}{\ensuremath\uparrow}%
@@ -11021,7 +11036,6 @@
   \DeclareUnicodeCharacter{21AA}{\ensuremath\hookrightarrow}%
   \DeclareUnicodeCharacter{21BC}{\ensuremath\leftharpoonup}%
   \DeclareUnicodeCharacter{21BD}{\ensuremath\leftharpoondown}%
-  \DeclareUnicodeCharacter{21BE}{\ensuremath\upharpoonright}%
   \DeclareUnicodeCharacter{21C0}{\ensuremath\rightharpoonup}%
   \DeclareUnicodeCharacter{21C1}{\ensuremath\rightharpoondown}%
   \DeclareUnicodeCharacter{21CC}{\ensuremath\rightleftharpoons}%
@@ -11030,8 +11044,6 @@
   \DeclareUnicodeCharacter{21D3}{\ensuremath\Downarrow}%
   \DeclareUnicodeCharacter{21D4}{\ensuremath\Leftrightarrow}%
   \DeclareUnicodeCharacter{21D5}{\ensuremath\Updownarrow}%
-  \DeclareUnicodeCharacter{21DD}{\ensuremath\leadsto}%
-  \DeclareUnicodeCharacter{2201}{\ensuremath\complement}%
   \DeclareUnicodeCharacter{2202}{\ensuremath\partial}%
   \DeclareUnicodeCharacter{2205}{\ensuremath\emptyset}%
   \DeclareUnicodeCharacter{2207}{\ensuremath\nabla}%
@@ -11065,8 +11077,6 @@
   \DeclareUnicodeCharacter{2283}{\ensuremath\supset}%
   \DeclareUnicodeCharacter{2286}{\ensuremath\subseteq}%
   \DeclareUnicodeCharacter{228E}{\ensuremath\uplus}%
-  \DeclareUnicodeCharacter{228F}{\ensuremath\sqsubset}%
-  \DeclareUnicodeCharacter{2290}{\ensuremath\sqsupset}%
   \DeclareUnicodeCharacter{2291}{\ensuremath\sqsubseteq}%
   \DeclareUnicodeCharacter{2292}{\ensuremath\sqsupseteq}%
   \DeclareUnicodeCharacter{2293}{\ensuremath\sqcap}%
@@ -11081,8 +11091,6 @@
   \DeclareUnicodeCharacter{22A4}{\ensuremath\ptextop}%
   \DeclareUnicodeCharacter{22A5}{\ensuremath\bot}%
   \DeclareUnicodeCharacter{22A8}{\ensuremath\models}%
-  \DeclareUnicodeCharacter{22B4}{\ensuremath\unlhd}%
-  \DeclareUnicodeCharacter{22B5}{\ensuremath\unrhd}%
   \DeclareUnicodeCharacter{22C0}{\ensuremath\bigwedge}%
   \DeclareUnicodeCharacter{22C1}{\ensuremath\bigvee}%
   \DeclareUnicodeCharacter{22C2}{\ensuremath\bigcap}%
@@ -11098,12 +11106,11 @@
   \DeclareUnicodeCharacter{2322}{\ensuremath\frown}%
   \DeclareUnicodeCharacter{2323}{\ensuremath\smile}%
   %
-  \DeclareUnicodeCharacter{25A1}{\ensuremath\Box}%
   \DeclareUnicodeCharacter{25B3}{\ensuremath\triangle}%
   \DeclareUnicodeCharacter{25B7}{\ensuremath\triangleright}%
   \DeclareUnicodeCharacter{25BD}{\ensuremath\bigtriangledown}%
   \DeclareUnicodeCharacter{25C1}{\ensuremath\triangleleft}%
-  \DeclareUnicodeCharacter{25C7}{\ensuremath\Diamond}%
+  \DeclareUnicodeCharacter{25C7}{\ensuremath\diamond}%
   \DeclareUnicodeCharacter{2660}{\ensuremath\spadesuit}%
   \DeclareUnicodeCharacter{2661}{\ensuremath\heartsuit}%
   \DeclareUnicodeCharacter{2662}{\ensuremath\diamondsuit}%
@@ -11125,7 +11132,6 @@
   \DeclareUnicodeCharacter{2A02}{\ensuremath\bigotimes}%
   \DeclareUnicodeCharacter{2A04}{\ensuremath\biguplus}%
   \DeclareUnicodeCharacter{2A06}{\ensuremath\bigsqcup}%
-  \DeclareUnicodeCharacter{2A1D}{\ensuremath\Join}%
   \DeclareUnicodeCharacter{2A3F}{\ensuremath\amalg}%
   \DeclareUnicodeCharacter{2AAF}{\ensuremath\preceq}%
   \DeclareUnicodeCharacter{2AB0}{\ensuremath\succeq}%

Modified: branches/stable/source/src/build-aux/ylwrap
===================================================================
--- branches/stable/source/src/build-aux/ylwrap	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/build-aux/ylwrap	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,9 +1,9 @@
 #! /bin/sh
 # ylwrap - wrapper for lex/yacc invocations.
 
-scriptversion=2013-01-12.17; # UTC
+scriptversion=2016-01-11.22; # UTC
 
-# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+# Copyright (C) 1996-2017 Free Software Foundation, Inc.
 #
 # Written by Tom Tromey <tromey at cygnus.com>.
 #
@@ -242,6 +242,6 @@
 # eval: (add-hook 'write-file-hooks 'time-stamp)
 # time-stamp-start: "scriptversion="
 # time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
+# time-stamp-time-zone: "UTC0"
 # time-stamp-end: "; # UTC"
 # End:

Modified: branches/stable/source/src/configure
===================================================================
--- branches/stable/source/src/configure	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/configure	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for TeX Live 2016-05-23.
+# Generated by GNU Autoconf 2.69 for TeX Live 2017-06-20.
 #
 # Report bugs to <tex-k at tug.org>.
 #
@@ -590,8 +590,8 @@
 # Identity of this package.
 PACKAGE_NAME='TeX Live'
 PACKAGE_TARNAME='tex-live'
-PACKAGE_VERSION='2016-05-23'
-PACKAGE_STRING='TeX Live 2016-05-23'
+PACKAGE_VERSION='2017-06-20'
+PACKAGE_STRING='TeX Live 2017-06-20'
 PACKAGE_BUGREPORT='tex-k at tug.org'
 PACKAGE_URL=''
 
@@ -1503,7 +1503,7 @@
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures TeX Live 2016-05-23 to adapt to many kinds of systems.
+\`configure' configures TeX Live 2017-06-20 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1577,7 +1577,7 @@
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of TeX Live 2016-05-23:";;
+     short | recursive ) echo "Configuration of TeX Live 2017-06-20:";;
    esac
   cat <<\_ACEOF
 
@@ -1889,7 +1889,7 @@
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-TeX Live configure 2016-05-23
+TeX Live configure 2017-06-20
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2666,7 +2666,7 @@
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by TeX Live $as_me 2016-05-23, which was
+It was created by TeX Live $as_me 2017-06-20, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -10762,7 +10762,7 @@
 
 # Define the identity of the package.
  PACKAGE='tex-live'
- VERSION='2016-05-23'
+ VERSION='2017-06-20'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -22729,7 +22729,7 @@
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by TeX Live $as_me 2016-05-23, which was
+This file was extended by TeX Live $as_me 2017-06-20, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -22786,7 +22786,7 @@
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-TeX Live config.status 2016-05-23
+TeX Live config.status 2017-06-20
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
@@ -24742,11 +24742,11 @@
 test "x$srcdir" = x. || msg_compiling="$msg_compiling
       from sources in $kpse_src"
 { $as_echo "$as_me:${as_lineno-$LINENO}: result:
-** Configuration summary for $PACKAGE_STRING (2017$with_banner_add):
+** Configuration summary for $PACKAGE_STRING (2018/dev$with_banner_add):
 
    $msg_compiling" >&5
 $as_echo "
-** Configuration summary for $PACKAGE_STRING (2017$with_banner_add):
+** Configuration summary for $PACKAGE_STRING (2018/dev$with_banner_add):
 
    $msg_compiling" >&6; }
 case $kpse_src$kpse_bld in

Modified: branches/stable/source/src/doc/Makefile.in
===================================================================
--- branches/stable/source/src/doc/Makefile.in	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/doc/Makefile.in	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.15.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2017 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,

Modified: branches/stable/source/src/doc/build-tools.txt
===================================================================
--- branches/stable/source/src/doc/build-tools.txt	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/doc/build-tools.txt	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,7 +1,7 @@
 autoconf (GNU Autoconf) 2.69
-automake (GNU automake) 1.15
+automake (GNU automake) 1.15.1
 bison (GNU Bison) 3.0.4
 flex 2.6.0
 ltmain.sh (GNU libtool) 2.4.6
 m4 (GNU M4) 1.4.18
-makeinfo (GNU texinfo) 6.1
+makeinfo (GNU texinfo) 6.4

Modified: branches/stable/source/src/doc/tlbuild.info
===================================================================
--- branches/stable/source/src/doc/tlbuild.info	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/doc/tlbuild.info	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,4 +1,4 @@
-This is tlbuild.info, produced by makeinfo version 6.3 from
+This is tlbuild.info, produced by makeinfo version 6.4 from
 tlbuild.texi.
 
 This file documents the TeX Live build system and more.
@@ -591,12 +591,12 @@
    Currently the versions we use are:
 
      autoconf (GNU Autoconf) 2.69
-     automake (GNU automake) 1.15
+     automake (GNU automake) 1.15.1
      bison (GNU Bison) 3.0.4
      flex 2.6.0
      ltmain.sh (GNU libtool) 2.4.6
      m4 (GNU M4) 1.4.18
-     makeinfo (GNU texinfo) 6.1
+     makeinfo (GNU texinfo) 6.4
 
    These versions should be used to update the generated files (e.g.,
 'configure' or 'Makefile.in') in all or parts of the TL tree after their
@@ -1998,7 +1998,6 @@
 * install-tl DESCRIPTION::
 * install-tl REFERENCES::
 * install-tl OPTIONS::
-* install-tl PROFILES::
 * install-tl ENVIRONMENT VARIABLES::
 * install-tl AUTHORS AND COPYRIGHT::
 
@@ -2018,10 +2017,8 @@
 
 install-tl [_option_]...
 
-   install-tl-windows.bat [_option_]...
+   install-tl.bat [_option_]...
 
-   install-tl-advanced.bat [_option_]...
-
 
 File: tlbuild.info,  Node: install-tl DESCRIPTION,  Next: install-tl REFERENCES,  Prev: install-tl SYNOPSIS,  Up: install-tl
 
@@ -2029,22 +2026,21 @@
 ===============
 
 This installer creates a runnable TeX Live installation from various
-media, including over the network, from local hard disk, a DVD, etc.
-The installer works across all platforms supported by TeX Live.  For
-information on initially downloading the TeX Live, see
-<http://tug.org/texlive/acquire.html>.
+media, including over the network.  The installer works across all
+platforms supported by TeX Live.  For information on initially
+downloading the TeX Live, see <http://tug.org/texlive/acquire.html>.
 
-   The basic idea of TeX Live installation is for you to choose one of
-the top-level _schemes_, each of which is defined as a different set of
+   The basic idea of TeX Live installation is to choose one of the
+top-level _schemes_, each of which is defined as a different set of
 _collections_ and _packages_, where a collection is a set of packages,
 and a package is what contains actual files.
 
    Within the installer, you can choose a scheme, and further customize
 the set of collections to install, but not the set of the packages.  To
-work at the package level, use 'tlmgr' (reference just below) after the
-initial installation is complete.
+do that, use 'tlmgr' (reference below) after the initial installation is
+completely.
 
-   The default is 'scheme-full', which installs everything, and this is
+   The default is 'scheme-full', to install everything, and this is
 highly recommended.
 
 
@@ -2057,14 +2053,14 @@
 handled through *tlmgr*(1), the TeX Live Manager
 (<http://tug.org/texlive/tlmgr.html>).
 
-   The most up-to-date version of this installer documentation is on the
-Internet at <http://tug.org/texlive/doc/install-tl.html>.
+   The most up-to-date version of this documentation is on the Internet
+at <http://tug.org/texlive/doc/install-tl.html>.
 
    For the full documentation of TeX Live, see
 <http://tug.org/texlive/doc>.
 
 
-File: tlbuild.info,  Node: install-tl OPTIONS,  Next: install-tl PROFILES,  Prev: install-tl REFERENCES,  Up: install-tl
+File: tlbuild.info,  Node: install-tl OPTIONS,  Next: install-tl ENVIRONMENT VARIABLES,  Prev: install-tl REFERENCES,  Up: install-tl
 
 A.5 OPTIONS
 ===========
@@ -2075,7 +2071,7 @@
 
 *-gui* [[=]_module_]
 
-     If no _module_ is given, starts the 'perltk' (see below) GUI
+     If no _module_ is given starts the 'perltk' (see below) GUI
      installer.
 
      If _module_ is given loads the given installer module.  Currently
@@ -2098,7 +2094,7 @@
           'install-tl-advanced.bat'.
 
      The 'perltk' and 'wizard' modules, and thus also when calling with
-     bare '-gui' (with no _module_), require the Perl/Tk module
+     a bare '-gui' (without _module_), requires the Perl/Tk module
      (<http://tug.org/texlive/distro.html#perltk>); if Perl/Tk is not
      available, installation continues in text mode.
 
@@ -2123,9 +2119,8 @@
 
      Specify the package repository to be used as the source of the
      installation, either a local directory via '/path/to/directory' or
-     a 'file:/' url, or a network location via a 'http://', 'https://',
-     or 'ftp://' url.  (No other protocols are supported, and 'https://'
-     may not work on all platforms.)
+     a 'file:/' url, or a network location via a 'http://' or 'ftp://'
+     url.  (No other protocols are supported.)
 
      The default is to pick a mirror automatically, using
      <http://mirror.ctan.org/systems/texlive/tlnet>; the chosen mirror
@@ -2140,9 +2135,9 @@
 
        -repository http://ctan.example.org/its/ctan/dir/systems/texlive/tlnet
 
-     Of course a real hostname and its particular top-level CTAN
-     directory have to be specified.  The list of CTAN mirrors is
-     available at <http://ctan.org/mirrors>.
+     Of course a real hostname and its particular top-level CTAN path
+     have to be specified.  The list of CTAN mirrors is available at
+     <http://ctan.org/mirrors>.
 
      If the repository is local, the installation type (compressed or
      live) is automatically determined, by checking for the presence of
@@ -2173,9 +2168,9 @@
 *-all-options*
 
      Normally options not relevant to the current platform are not shown
-     (e.g., when running on Unix, Windows-specific options are omitted).
-     Giving this command line option allows configuring such "foreign"
-     settings.
+     (i.e., when running on Unix, Windows-specific options are omitted).
+     Giving this command line option allows configuring settings in the
+     final 'texlive.tlpdb' that do not have any immediate effect.
 
 *-custom-bin* _path_
 
@@ -2186,13 +2181,10 @@
      installation will continue as usual, but at the end all files from
      _path_ are copied over to 'bin/custom/' under your installation
      directory and this 'bin/custom/' directory is what will be added to
-     the path for the post-install actions.  To install multiple custom
-     binary sets, manully rename 'custom' before doing each.
+     the path for the post-install actions.  (By the way, for
+     information on building TeX Live, see
+     <http://tug.org/texlive/build.html>).
 
-     For more information on custom binaries, see
-     <http://tug.org/texlive/custom-bin.html>.  For general information
-     on building TeX Live, see <http://tug.org/texlive/build.html>.
-
 *-debug-translation*
 
      In GUI mode, this switch makes 'tlmgr' report any missing, or more
@@ -2208,7 +2200,7 @@
 
 *-help*, *-help*, *-?*
 
-     Display this help and exit.  (This help is on the web at
+     Display this help and exit (on the web via
      <http://tug.org/texlive/doc/install-tl.html>).  Sometimes the
      'perldoc' and/or 'PAGER' programs on the system have problems,
      possibly resulting in control characters being literally output.
@@ -2226,12 +2218,6 @@
      option is not available via the installer interfaces.  USE AT YOUR
      OWN RISK.
 
-*-init-from-profile* _profile_file_
-
-     Similar to *-profile* (see *note PROFILES: install-tl PROFILES.
-     below), but only initializes the installation configuration from
-     _profile_file_ and then starts the interactive session.
-
 *-logfile* _file_
 
      Write both all messages (informational, debugging, warnings) to
@@ -2243,7 +2229,7 @@
 
 *-no-cls*
 
-     For the text mode installer only: do not clear the screen when
+     (only for text mode installer) do not clear the screen when
      entering a new menu (for debugging purposes).
 
 *-non-admin*
@@ -2265,16 +2251,8 @@
      This option is turned on by default, and the installation program
      will fall back to using 'wget' if this is not possible.  To disable
      usage of LWP and persistent connections, use
-     '-no-persistent-downloads'.
+     '--no-persistent-downloads'.
 
-*-no-verify-downloads*
-
-     By default, if a GnuPG 'gpg' binary is found in PATH, downloads are
-     verified against a cryptographic signature.  This option disables
-     such verification.  The full description is in the Crytographic
-     Verification section of the 'tlmgr' documentation, e.g.,
-     <http://tug.org/texlive/doc/tlmgr.html#CRYPTOGRAPHIC-VERIFICATION>
-
 *-portable*
 
      Install for portable use, e.g., on a USB stick.  Also selectable
@@ -2286,12 +2264,34 @@
      (hardware/operating system) combination to standard output, and
      exit.  '-print-arch' is a synonym.
 
-*-profile* _profile_file_
+*-profile* _profile_
 
-     Load _profile_file_ and do the installation with no user
-     interaction, that is, a batch (unattended) install.  See *note
-     PROFILES: install-tl PROFILES. below.
+     Load the file _profile_ and do the installation with no user
+     interaction, that is, a batch (unattended) install.
 
+     A _profile_ file contains all the values needed to perform an
+     installation.  After a normal installation has finished, a profile
+     for that exact installation is written to the file
+     DEST/tlpkg/texlive.profile.  That file can be given as the argument
+     to '-profile' to redo the exact same installation on a different
+     system, for example.  Alternatively, you can use a custom profile,
+     most easily created by starting from a generated one and changing
+     values, or an empty file, which will take all the defaults.
+
+     Normally a profile has to specify the value '1' for each collection
+     to be installed, even if the scheme is specified.  This follows
+     from the logic of the installer in that you can first select a
+     scheme and then change the collections being installed.  But for
+     convenience there is an exception to this within profiles: If the
+     profile contains a variable for 'selected_scheme' and _no_
+     collection variables at all are defined in the profile, then the
+     collections which the specified scheme requires are installed.
+
+     Thus, a line 'selected_scheme scheme-medium' together with the
+     definitions of the installation directories ('TEXDIR', 'TEXMFHOME',
+     'TEXMFLOCAL', 'TEXMFSYSCONFIG', 'TEXMFSYSVAR') suffices to install
+     the medium scheme with all default options.
+
 *-q*
 
      Omit normal informational messages.
@@ -2308,8 +2308,8 @@
 
 *-v*
 
-     Include verbose debugging messages; repeat for maximum debugging:
-     '-v -v'.  (Further repeats are accepted but ignored.)
+     Include verbose debugging messages; repeat for maximum debugging,
+     as in '-v -v'.  (Further repeats are accepted but ignored.)
 
 *-version*, *-version*
 
@@ -2317,143 +2317,13 @@
      the revisions of the used modules are reported, too.
 
 
-File: tlbuild.info,  Node: install-tl PROFILES,  Next: install-tl ENVIRONMENT VARIABLES,  Prev: install-tl OPTIONS,  Up: install-tl
+File: tlbuild.info,  Node: install-tl ENVIRONMENT VARIABLES,  Next: install-tl AUTHORS AND COPYRIGHT,  Prev: install-tl OPTIONS,  Up: install-tl
 
-A.6 PROFILES
-============
-
-A _profile_ file contains all the values needed to perform an
-installation.  After a normal installation has finished, a profile for
-that exact installation is written to the file 'tlpkg/texlive.profile'.
-In addition, from the text menu one can select 'P' to save the current
-setup as a profile at any time.  Such a profile file can be given as the
-argument to '-profile', for example to redo the exact same installation
-on a different system.  Alternatively, you can use a custom profile,
-most easily created by starting from a generated one and changing
-values, or an empty file, which will take all the defaults.
-
-   Within a profile file, each line consists of
-
-   _variable_ [_value_]
-
-   except for comment lines starting with '#'.  The possible variable
-names are listed below.  Values, when present, are either '0' or '1' for
-booleans, or strings (which must be specified without any quote
-characters).  Leading whitespace is ignored.
-
-   If the variable 'selected_scheme' is defined and _no_ collection
-variables at all are defined, then the collections required by the
-specified scheme (which might change over time) are installed, without
-explicitly listing them.  This eases maintenance of profile files.  If
-any collections are specified in a profile, though, then all desired
-collections must be given explicitly.
-
-   For example, a line
-
-  selected_scheme scheme-small
-
-   along with definitions for the installation directories (given below
-under "path options") suffices to install the "small" scheme with all
-default options.  The schemes are described in the 'S' menu in the text
-installer, or equivalent.
-
-   Besides 'selected_scheme', here is the list of variable names
-supported in a profile:
-
-   *collection options* (prefix 'collection-')
-
-   Collections are specified with a variable name with the prefix
-'collection-' followed by a collection name; there is no value.  For
-instance, 'collection-basic'.  The collections are described in the 'C'
-menu.
-
-   Schemes and collections (and packages) are ultimately defined by the
-files in the 'tlpkg/tlpsrc/' source directory.
-
-   *path options*
-
-   It is best to define all of these, even though they may not be used
-in the installation, so as to avoid unintentionally getting a default
-value that could cause problems later.
-
-  TEXDIR
-  TEXMFCONFIG
-  TEXMFVAR
-  TEXMFHOME
-  TEXMFLOCAL
-  TEXMFSYSCONFIG
-  TEXMFSYSVAR
-
-   *installer options* (prefix 'instopt_')
-
-'instopt_adjustpath' (default 0 on Unix, 1 on Windows)
-
-     Adjust 'PATH' environment variable.
-
-'instopt_adjustrepo' (default 1)
-
-     Set remote repository to a multiplexed CTAN mirror after
-     installation; see '-repository' above.
-
-'instopt_letter' (default 0)
-
-     Set letter size paper as the default, instead of a4.
-
-'instopt_portable' (default 0)
-
-     Install for portable use, e.g., on a USB stick.
-
-'instopt_write18_restricted' (default 1)
-
-     Enable '\write18' for a restricted set of programs.
-
-   *tlpdb options* (prefix 'tlpdbopt_')
-
-   The definitive list is given in 'tlpkg/TeXLive/TLConfig.pm', in
-'%TeXLive::TLConfig::TLPDBOptions', together with explanations.  All
-items given there _except_ for 'tlpdbopt_location' can be specified.
-Here is the current list:
-
-  tlpdbopt_autobackup
-  tlpdbopt_backupdir
-  tlpdbopt_create_formats
-  tlpdbopt_desktop_integration
-  tlpdbopt_file_assocs
-  tlpdbopt_generate_updmap
-  tlpdbopt_install_docfiles
-  tlpdbopt_install_srcfiles
-  tlpdbopt_post_code
-  tlpdbopt_sys_bin
-  tlpdbopt_sys_info
-  tlpdbopt_sys_man
-  tlpdbopt_w32_multi_user
-
-   *platform options* (prefix 'binary_')
-
-   For each supported platform in TeX Live (directories under 'bin/'),
-the variable 'binary_'_PLATFORM_ can be set.  For example:
-
-  binary_x86_64-linux
-
-   If no 'binary_' variable is specified, the default is whatever the
-current machine is running.
-
-   In releases before 2017, many profile variables had different names
-(not documented here; see the 'install-tl' source).  They are accepted
-and transformed to the names given above.  When a profile is written,
-the names above are always used.
-
-   For more details on all of the above options, consult the TeX Live
-installation manual, linked from <http://tug.org/texlive/doc>.
-
-
-File: tlbuild.info,  Node: install-tl ENVIRONMENT VARIABLES,  Next: install-tl AUTHORS AND COPYRIGHT,  Prev: install-tl PROFILES,  Up: install-tl
-
-A.7 ENVIRONMENT VARIABLES
+A.6 ENVIRONMENT VARIABLES
 =========================
 
 For ease in scripting and debugging, 'install-tl' will look for the
-following environment variables.  They are not of interest for normal
+following environment variables.  They are not of interest in normal
 user installations.
 
 'TEXLIVE_INSTALL_ENV_NOCHECK'
@@ -2467,19 +2337,10 @@
      Omit creating the ConTeXt cache.  This is useful for
      redistributors.
 
-'TEXLIVE_INSTALL_NO_WELCOME'
-
-     Omit printing the welcome message after successful installation,
-     e.g., for testing.
-
 'TEXLIVE_INSTALL_PREFIX'
 
-'TEXLIVE_INSTALL_TEXDIR'
-
 'TEXLIVE_INSTALL_TEXMFCONFIG'
 
-'TEXLIVE_INSTALL_TEXMFVAR'
-
 'TEXLIVE_INSTALL_TEXMFHOME'
 
 'TEXLIVE_INSTALL_TEXMFLOCAL'
@@ -2488,13 +2349,10 @@
 
 'TEXLIVE_INSTALL_TEXMFSYSVAR'
 
-     Specify the respective directories.  'TEXLIVE_INSTALL_PREFIX'
-     defaults to '/usr/local/texlive', while 'TEXLIVE_INSTALL_TEXDIR'
-     defaults to the release directory within that prefix, e.g.,
-     '/usr/local/texlive/2016'.  All the defaults can be seen by running
-     the installer interactively and then typing 'D' for the directory
-     menu.
+'TEXLIVE_INSTALL_TEXMFVAR'
 
+     Specify the respective directories.
+
 'NOPERLDOC'
 
      Don't try to run the '--help' message through 'perldoc'.
@@ -2502,7 +2360,7 @@
 
 File: tlbuild.info,  Node: install-tl AUTHORS AND COPYRIGHT,  Prev: install-tl ENVIRONMENT VARIABLES,  Up: install-tl
 
-A.8 AUTHORS AND COPYRIGHT
+A.7 AUTHORS AND COPYRIGHT
 =========================
 
 This script and its documentation were written for the TeX Live
@@ -2509,8 +2367,6 @@
 distribution (<http://tug.org/texlive>) and both are licensed under the
 GNU General Public License Version 2 or later.
 
-   $Id: install-tl 44407 2017-05-18 21:25:39Z karl $
-
 
 File: tlbuild.info,  Node: tlmgr,  Next: Index,  Prev: install-tl,  Up: Top
 
@@ -2525,9 +2381,9 @@
 * tlmgr EXAMPLES::
 * tlmgr OPTIONS::
 * tlmgr ACTIONS::
+* tlmgr USER MODE::
 * tlmgr CONFIGURATION FILE FOR TLMGR::
-* tlmgr CRYPTOGRAPHIC VERIFICATION::
-* tlmgr USER MODE::
+* tlmgr TAXONOMIES::
 * tlmgr MULTIPLE REPOSITORIES::
 * tlmgr GUI FOR TLMGR::
 * tlmgr MACHINE-READABLE OUTPUT::
@@ -2539,7 +2395,7 @@
 B.1 NAME
 ========
 
-tlmgr - the native TeX Live Manager
+tlmgr - the TeX Live Manager
 
 
 File: tlbuild.info,  Node: tlmgr SYNOPSIS,  Next: tlmgr DESCRIPTION,  Prev: tlmgr NAME,  Up: tlmgr
@@ -2583,17 +2439,11 @@
 After successfully installing TeX Live, here are a few common operations
 with 'tlmgr':
 
-'tlmgr option repository ctan'
-
 'tlmgr option repository http://mirror.ctan.org/systems/texlive/tlnet'
 
      Tell 'tlmgr' to use a nearby CTAN mirror for future updates; useful
-     if you installed TeX Live from the DVD image and want to have
-     continuing updates.  The two commands are equivalent; 'ctan' is
-     just an alias for the given url.  Caveat: 'mirror.ctan.org'
-     resolves to many different hosts, and they are not perfectly
-     synchronized; we recommend updating only daily (at most), and not
-     more often.
+     if you installed TeX Live from the DVD image and want continuing
+     updates.
 
 'tlmgr update --list'
 
@@ -2604,11 +2454,10 @@
      Make your local TeX installation correspond to what is in the
      package repository (typically useful when updating from CTAN).
 
-'tlmgr info' _what_
+'tlmgr info' _pkg_
 
-     Display detailed information about a package _what_, such as the
-     installation status and description, of searches for _what_ in all
-     packages.
+     Display detailed information about _pkg_, such as the installation
+     status and description.
 
    For all the capabilities and details of 'tlmgr', please read the
 following voluminous information.
@@ -2690,8 +2539,8 @@
 
      'tlmgr' logs all package actions (install, remove, update, failed
      updates, failed restores) to a separate log file, by default
-     'TEXMFSYSVAR/web2c/tlmgr.log'.  This option allows you to specify a
-     different file for the log.
+     'TEXMFSYSVAR/web2c/tlmgr.log'.  This option allows you to specific
+     a different file for the log.
 
 *-pause*
 
@@ -2719,15 +2568,6 @@
      below).  Documented only for completeness, as this is only useful
      in debugging.
 
-*-require-verification*
-
-*-no-require-verification*
-
-     Instructs 'tlmgr' to only accept signed and verified remotes.  In
-     any other case 'tlmgr' will quit operation.  See *note
-     CRYPTOGRAPHIC VERIFICATION: tlmgr CRYPTOGRAPHIC VERIFICATION. below
-     for details.
-
 *-usermode*
 
      Activates user mode for this run of 'tlmgr'; see *note USER MODE:
@@ -2738,16 +2578,6 @@
      Uses _dir_ for the tree in user mode; see *note USER MODE: tlmgr
      USER MODE. below.
 
-*-verify-downloads*
-
-*-no-verify-downloads*
-
-     Enables or disables cryptographic verification of downloaded
-     database files.  A working GnuPG ('gpg') binary needs to be present
-     in the path, otherwise this option has no effect.  See *note
-     CRYPTOGRAPHIC VERIFICATION: tlmgr CRYPTOGRAPHIC VERIFICATION. below
-     for details.
-
    The standard options for TeX Live programs are also accepted:
 '--help/-h/-?', '--version', '-q' (no informational messages), '-v'
 (debugging messages, can be repeated).  For the details about these, see
@@ -2758,7 +2588,7 @@
 revision number for the loaded TeX Live Perl modules are shown, too.
 
 
-File: tlbuild.info,  Node: tlmgr ACTIONS,  Next: tlmgr CONFIGURATION FILE FOR TLMGR,  Prev: tlmgr OPTIONS,  Up: tlmgr
+File: tlbuild.info,  Node: tlmgr ACTIONS,  Next: tlmgr USER MODE,  Prev: tlmgr OPTIONS,  Up: tlmgr
 
 B.6 ACTIONS
 ===========
@@ -2771,7 +2601,6 @@
 * tlmgr candidates _pkg_::
 * tlmgr check [_option_]... [files|depends|executes|runfiles|all]::
 * tlmgr conf [texmf|tlmgr|updmap [--conffile _file_] [--delete] [_key_ [_value_]]]::
-* tlmgr conf auxtrees [--conffile _file_] [show|add|delete] [_value_]::
 * tlmgr dump-tlpdb [--local|--remote]::
 * tlmgr generate [_option_]... _what_::
 * tlmgr gui::
@@ -2778,7 +2607,6 @@
 * tlmgr info [_option_...] [collections|schemes|_pkg_...]::
 * tlmgr init-usertree::
 * tlmgr install [_option_]... _pkg_...::
-* tlmgr key list|add _file_|remove _keyid_::
 * tlmgr option::
 * tlmgr paper::
 * tlmgr path [--w32mode=user|admin] [add|remove]::
@@ -2788,11 +2616,10 @@
 * tlmgr platform set auto::
 * tlmgr postaction [--w32mode=user|admin] [--fileassocmode=1|2] [--all] [install|remove] [shortcut|fileassoc|script] [_pkg_]...::
 * tlmgr print-platform::
+* tlmgr restore [--backupdir _dir_] [--all | _pkg_ [_rev_]]::
 * tlmgr remove [_option_]... _pkg_...::
 * tlmgr repository::
-* tlmgr restore [--backupdir _dir_] [--all | _pkg_ [_rev_]]::
 * tlmgr search [_option_...] _what_::
-* tlmgr shell::
 * tlmgr uninstall::
 * tlmgr update [_option_]... [_pkg_]...::
 
@@ -2894,8 +2721,8 @@
 *depends*
 
      Lists those packages which occur as dependencies in an installed
-     collection, but are themselves not installed, and those packages
-     which are not contained in any collection.
+     collections, but are themselves not installed, and those packages
+     that are not contained in any collection.
 
      If you call 'tlmgr check collections' this test will be carried out
      instead since former versions for 'tlmgr' called it that way.
@@ -2908,7 +2735,7 @@
 *runfiles*
 
      List those filenames that are occurring more than one time in the
-     runfiles sections.
+     runfiles.
 
    Options:
 
@@ -2918,67 +2745,51 @@
      checking the TL development repository.
 
 
-File: tlbuild.info,  Node: tlmgr conf [texmf|tlmgr|updmap [--conffile _file_] [--delete] [_key_ [_value_]]],  Next: tlmgr conf auxtrees [--conffile _file_] [show|add|delete] [_value_],  Prev: tlmgr check [_option_]... [files|depends|executes|runfiles|all],  Up: tlmgr ACTIONS
+File: tlbuild.info,  Node: tlmgr conf [texmf|tlmgr|updmap [--conffile _file_] [--delete] [_key_ [_value_]]],  Next: tlmgr dump-tlpdb [--local|--remote],  Prev: tlmgr check [_option_]... [files|depends|executes|runfiles|all],  Up: tlmgr ACTIONS
 
 B.6.6 conf [texmf|tlmgr|updmap [-conffile _file_] [-delete] [_key_ [_value_]]]
 ------------------------------------------------------------------------------
 
-
-File: tlbuild.info,  Node: tlmgr conf auxtrees [--conffile _file_] [show|add|delete] [_value_],  Next: tlmgr dump-tlpdb [--local|--remote],  Prev: tlmgr conf [texmf|tlmgr|updmap [--conffile _file_] [--delete] [_key_ [_value_]]],  Up: tlmgr ACTIONS
-
-B.6.7 conf auxtrees [-conffile _file_] [show|add|delete] [_value_]
-------------------------------------------------------------------
-
 With only 'conf', show general configuration information for TeX Live,
 including active configuration files, path settings, and more.  This is
-like running 'texconfig conf', but works on all supported platforms.
+like the 'texconfig conf' call, but works on all supported platforms.
 
-   With one of 'conf texmf', 'conf tlmgr', or 'conf updmap', shows all
-key/value pairs (i.e., all settings) as saved in 'ROOT/texmf.cnf', the
-user-specific 'tlmgr' configuration file (see below), or the first found
-(via 'kpsewhich') 'updmap.cfg' file, respectively.
+   With either 'conf texmf', 'conf tlmgr', or 'conf updmap' given in
+addition, shows all key/value pairs (i.e., all settings) as saved in
+'ROOT/texmf.cnf', the tlmgr configuration file (see below), or the first
+found (via kpsewhich) 'updmap.cfg' file, respectively.
 
    If _key_ is given in addition, shows the value of only that _key_ in
-the respective file.  If option _-delete_ is also given, the value in
-the given configuration file is entirely removed (not just commented
-out).
+the respective file.  If option _-delete_ is also given, the
+configuration file - it is removed, not just commented out!
 
    If _value_ is given in addition, _key_ is set to _value_ in the
 respective file.  _No error checking is done!_
 
-   The 'PATH' value shown by 'conf' is as used by 'tlmgr'.  The
-directory in which the 'tlmgr' executable is found is automatically
-prepended to the PATH value inherited from the environment.
+   In all cases the file used can be explicitly specified via the option
+'--conffile _file_', in case one wants to operate on a different file.
 
-   Here is a practical example of changing configuration values.  If the
-execution of (some or all) system commands via '\write18' was left
-enabled during installation, you can disable it afterwards:
+   Practical application: if the execution of (some or all) system
+commands via '\write18' was left enabled during installation, you can
+disable it afterwards:
 
   tlmgr conf texmf shell_escape 0
 
-   The subcommand 'auxtrees' allows adding and removing arbitrary
-additional texmf trees, completely under user control.  'auxtrees show'
-shows the list of additional trees, 'auxtrees add' _tree_ adds a tree to
-the list, and 'auxtrees remove' _tree_ removes a tree from the list (if
-present).  The trees should not contain an 'ls-R' file (or files might
-not be found if the 'ls-R' becomes stale).  This works by manipulating
-the Kpathsea variable 'TEXMFAUXTREES', in 'ROOT/texmf.cnf'.  Example:
+   A more complicated example: the 'TEXMFHOME' tree (see the main TeX
+Live guide, <http://tug.org/texlive/doc.html>) can be set to multiple
+directories, but they must be enclosed in braces and separated by
+commas, so quoting the value to the shell is a good idea.  Thus:
 
-  tlmgr conf auxtrees add /quick/test/tree
-  tlmgr conf auxtrees remove /quick/test/tree
+  tlmgr conf texmf TEXMFHOME "{~/texmf,~/texmfbis}"
 
-   In all cases the configuration file can be explicitly specified via
-the option '--conffile' _file_, if desired.
+   Warning: The general facility is here, but tinkering with settings in
+this way is very strongly discouraged.  Again, no error checking on
+either keys or values is done, so any sort of breakage is possible.
 
-   Warning: The general facility for changing configuration values is
-here, but tinkering with settings in this way is strongly discouraged.
-Again, no error checking on either keys or values is done, so any sort
-of breakage is possible.
-
 
-File: tlbuild.info,  Node: tlmgr dump-tlpdb [--local|--remote],  Next: tlmgr generate [_option_]... _what_,  Prev: tlmgr conf auxtrees [--conffile _file_] [show|add|delete] [_value_],  Up: tlmgr ACTIONS
+File: tlbuild.info,  Node: tlmgr dump-tlpdb [--local|--remote],  Next: tlmgr generate [_option_]... _what_,  Prev: tlmgr conf [texmf|tlmgr|updmap [--conffile _file_] [--delete] [_key_ [_value_]]],  Up: tlmgr ACTIONS
 
-B.6.8 dump-tlpdb [-local|-remote]
+B.6.7 dump-tlpdb [-local|-remote]
 ---------------------------------
 
 Dump complete local or remote TLPDB to standard output, as-is.  The
@@ -2989,11 +2800,11 @@
 
 *-local*
 
-     Dump the local TLPDB.
+     Dump the local tlpdb.
 
 *-remote*
 
-     Dump the remote TLPDB.
+     Dump the remote tlpdb.
 
    Exactly one of '--local' and '--remote' must be given.
 
@@ -3011,7 +2822,7 @@
 
 File: tlbuild.info,  Node: tlmgr generate [_option_]... _what_,  Next: tlmgr gui,  Prev: tlmgr dump-tlpdb [--local|--remote],  Up: tlmgr ACTIONS
 
-B.6.9 generate [_option_]... _what_
+B.6.8 generate [_option_]... _what_
 -----------------------------------
 
 *generate language*
@@ -3022,6 +2833,8 @@
 
 *generate language.dat.lua*
 
+*generate fmtutil*
+
    The 'generate' action overwrites any manual changes made in the
 respective files: it recreates them from scratch based on the
 information of the installed packages, plus local adaptions.  The TeX
@@ -3031,37 +2844,35 @@
    For managing your own fonts, please read the 'updmap --help'
 information and/or <http://tug.org/fonts/fontinstall.html>.
 
-   For managing your own formats, please read the 'fmtutil --help'
-information.
-
    In more detail: 'generate' remakes any of the configuration files
-'language.dat', 'language.def', and 'language.dat.lua' from the
-information present in the local TLPDB, plus locally-maintained files.
+'language.dat', 'language.def', 'language.dat.lua', and 'fmtutil.cnf',
+from the information present in the local TLPDB, plus locally-maintained
+files.
 
    The locally-maintained files are 'language-local.dat',
-'language-local.def', or 'language-local.dat.lua', searched for in
-'TEXMFLOCAL' in the respective directories.  If local additions are
-present, the final file is made by starting with the main file, omitting
-any entries that the local file specifies to be disabled, and finally
-appending the local file.
+'language-local.def', 'language-local.dat.lua', or 'fmtutil-local.cnf',
+searched for in 'TEXMFLOCAL' in the respective directories.  If local
+additions are present, the final file is made by starting with the main
+file, omitting any entries that the local file specifies to be disabled,
+and finally appending the local file.
 
-   (Historical note: The formerly supported 'updmap-local.cfg' and
-'fmtutil-local.cnf' are no longer read, since 'updmap' and 'fmtutil' now
-reads and supports multiple configuration files.  Thus, local additions
-can and should be put into an 'updmap.cfg' of 'fmtutil.cnf' file in
-'TEXMFLOCAL'.  The 'generate updmap' and 'generate fmtutil' actions no
-longer exist.)
+   (Historical note: The formerly supported 'updmap-local.cfg' is no
+longer read, since 'updmap' now supports multiple 'updmap.cfg' files.
+Thus, local additions can and should be put into an 'updmap.cfg' file in
+'TEXMFLOCAL'.  The 'generate updmap' action no longer exists.)
 
    Local files specify entries to be disabled with a comment line,
 namely one of these:
 
+  #!NAME
   %!NAME
   --!NAME
 
-   where 'language.dat' and 'language.def' use '%', and
-'language.dat.lua' use '--'.  In all cases, the _name_ is the respective
-format name or hyphenation pattern identifier.  Examples:
+   where 'fmtutil.cnf' uses '#', 'language.dat' and 'language.def' use
+'%', and 'language.dat.lua' use '--'.  In all cases, the _name_ is the
+respective format name or hyphenation pattern identifier.  Examples:
 
+  #!pdflatex
   %!german
   --!usenglishmax
 
@@ -3097,8 +2908,8 @@
 
 *-rebuild-sys*
 
-     tells 'tlmgr' to run necessary programs after config files have
-     been regenerated.  These are: 'fmtutil-sys --all' after 'generate
+     tells tlmgr to run necessary programs after config files have been
+     regenerated.  These are: 'fmtutil-sys --all' after 'generate
      fmtutil', 'fmtutil-sys --byhyphen .../language.dat' after 'generate
      language.dat', and 'fmtutil-sys --byhyphen .../language.def' after
      'generate language.def'.
@@ -3110,15 +2921,16 @@
 
    The respective locations are as follows:
 
-  tex/generic/config/language.dat (and language-local.dat)
-  tex/generic/config/language.def (and language-local.def)
-  tex/generic/config/language.dat.lua (and language-local.dat.lua)
+  tex/generic/config/language.dat (and language-local.dat);
+  tex/generic/config/language.def (and language-local.def);
+  tex/generic/config/language.dat.lua (and language-local.dat.lua);
+  web2c/fmtutil.cnf (and fmtutil-local.cnf);
 
 
 File: tlbuild.info,  Node: tlmgr gui,  Next: tlmgr info [_option_...] [collections|schemes|_pkg_...],  Prev: tlmgr generate [_option_]... _what_,  Up: tlmgr ACTIONS
 
-B.6.10 gui
-----------
+B.6.9 gui
+---------
 
 Start the graphical user interface.  See *GUI* below.
 
@@ -3125,7 +2937,7 @@
 
 File: tlbuild.info,  Node: tlmgr info [_option_...] [collections|schemes|_pkg_...],  Next: tlmgr init-usertree,  Prev: tlmgr gui,  Up: tlmgr ACTIONS
 
-B.6.11 info [_option_...] [collections|schemes|_pkg_...]
+B.6.10 info [_option_...] [collections|schemes|_pkg_...]
 --------------------------------------------------------
 
 With no argument, lists all packages available at the package
@@ -3135,20 +2947,10 @@
 lists the request type instead of all packages.
 
    With any other arguments, display information about _pkg_: the name,
-category, short and long description, sizes, installation status, and
-TeX Live revision number.  If _pkg_ is not locally installed, searches
-in the remote installation source.
+category, short and long description, installation status, and TeX Live
+revision number.  If _pkg_ is not locally installed, searches in the
+remote installation source.
 
-   For normal packages (not collections or schemes), the sizes of the
-four groups of files (run/src/doc/bin files) are shown separately.  For
-collections, the cumulative size is shown, including all
-directly-dependent packages (but not dependent collections).  For
-schemes, the cumulative size is also shown, including all
-directly-dependent collections and packages.
-
-   If _pkg_ is not found locally or remotely, the search action is used
-and lists matching packages and files.
-
    It also displays information taken from the TeX Catalogue, namely the
 package version, date, and license.  Consider these, especially the
 package version, as approximations only, due to timing skew of the
@@ -3169,14 +2971,26 @@
 
 *-only-installed*
 
-     If this option is given, the installation source will not be used;
+     If this options is given, the installation source will not be used;
      only locally installed packages, collections, or schemes are
-     listed.
+     listed.  (Does not work for listing of packages for now)
 
+*-taxonomy*
+
+*-keyword*
+
+*-functionality*
+
+*-characterization*
+
+     In addition to the normal data displayed, also display information
+     for given packages from the corresponding taxonomy (or all of
+     them).  See *note TAXONOMIES: tlmgr TAXONOMIES. below for details.
+
 
 File: tlbuild.info,  Node: tlmgr init-usertree,  Next: tlmgr install [_option_]... _pkg_...,  Prev: tlmgr info [_option_...] [collections|schemes|_pkg_...],  Up: tlmgr ACTIONS
 
-B.6.12 init-usertree
+B.6.11 init-usertree
 --------------------
 
 Sets up a texmf tree for so-called user mode management, either the
@@ -3184,23 +2998,14 @@
 with '--usertree'.  See *note USER MODE: tlmgr USER MODE. below.
 
 
-File: tlbuild.info,  Node: tlmgr install [_option_]... _pkg_...,  Next: tlmgr key list|add _file_|remove _keyid_,  Prev: tlmgr init-usertree,  Up: tlmgr ACTIONS
+File: tlbuild.info,  Node: tlmgr install [_option_]... _pkg_...,  Next: tlmgr option,  Prev: tlmgr init-usertree,  Up: tlmgr ACTIONS
 
-B.6.13 install [_option_]... _pkg_...
+B.6.12 install [_option_]... _pkg_...
 -------------------------------------
 
-Install each _pkg_ given on the command line, if it is not already
-installed.  (It does not touch existing packages; see the 'update'
-action for how to get the latest version of a package.)
+Install each _pkg_ given on the command line.  By default this installs
+all packages on which the given _pkg_s are dependent, also.  Options:
 
-   By default this also installs all packages on which the given _pkg_s
-are dependent.  Options:
-
-*-dry-run*
-
-     Nothing is actually installed; instead, the actions to be performed
-     are written to the terminal.
-
 *-file*
 
      Instead of fetching a package from the installation repository, use
@@ -3207,12 +3012,16 @@
      the package files given on the command line.  These files must be
      standard TeX Live package files (with contained tlpobj file).
 
-*-force*
+*-reinstall*
 
-     If updates to 'tlmgr' itself (or other parts of the basic
-     infrastructure) are present, 'tlmgr' will bail out and not perform
-     the installation unless this option is given.  Not recommended.
+     Reinstall a package (including dependencies for collections) even
+     if it already seems to be installed (i.e, is present in the TLPDB).
+     This is useful to recover from accidental removal of files in the
+     hierarchy.
 
+     When re-installing, only dependencies on normal packages are
+     followed (i.e., not those of category Scheme or Collection).
+
 *-no-depends*
 
      Do not install dependencies.  (By default, installing a package
@@ -3227,54 +3036,21 @@
      and also implies '--no-depends'.  Don't use it unless you are sure
      of what you are doing.
 
-*-reinstall*
+*-dry-run*
 
-     Reinstall a package (including dependencies for collections) even
-     if it already seems to be installed (i.e, is present in the TLPDB).
-     This is useful to recover from accidental removal of files in the
-     hierarchy.
+     Nothing is actually installed; instead, the actions to be performed
+     are written to the terminal.
 
-     When re-installing, only dependencies on normal packages are
-     followed (i.e., not those of category Scheme or Collection).
+*-force*
 
-*-with-doc*
+     If updates to 'tlmgr' itself (or other parts of the basic
+     infrastructure) are present, 'tlmgr' will bail out and not perform
+     the installation unless this option is given.  Not recommended.
 
-*-with-src*
-
-     While not recommended, the 'install-tl' program provides an option
-     to omit installation of all documentation and/or source files.  (By
-     default, everything is installed.)  After such an installation, you
-     may find that you want the documentation or source files for a
-     given package after all.  You can get them by using these options
-     in conjunction with '--reinstall', as in (using the 'fontspec'
-     package as the example):
-
-       tlmgr install --reinstall --with-doc --with-src fontspec
-
 
-File: tlbuild.info,  Node: tlmgr key list|add _file_|remove _keyid_,  Next: tlmgr option,  Prev: tlmgr install [_option_]... _pkg_...,  Up: tlmgr ACTIONS
+File: tlbuild.info,  Node: tlmgr option,  Next: tlmgr paper,  Prev: tlmgr install [_option_]... _pkg_...,  Up: tlmgr ACTIONS
 
-B.6.14 key list|add _file_|remove _keyid_
------------------------------------------
-
-The action 'key' allows listing, adding and removing additional GPG keys
-to the set of trusted keys, that is, those that are used to verify the
-TeX Live databases.
-
-   With the 'list' argument, 'key' lists all keys.
-
-   The 'add' argument requires another argument, either a filename or
-'-' for stdin, from which the key is added.  The key is added to the
-local keyring 'GNUPGHOME/repository-keys.gpg', which is normally)
-'tlpkg/gpg/repository-keys.gpg'.
-
-   The 'remove' argument requires a key id and removes the requested id
-from the local keyring.
-
-
-File: tlbuild.info,  Node: tlmgr option,  Next: tlmgr paper,  Prev: tlmgr key list|add _file_|remove _keyid_,  Up: tlmgr ACTIONS
-
-B.6.15 option
+B.6.13 option
 -------------
 
 *option [show]*
@@ -3330,9 +3106,7 @@
 
    The 'docfiles' and 'srcfiles' options control the installation of
 their respective files of a package.  By default both are enabled (1).
-Either or both can be disabled (set to 0) if disk space is limited or
-for minimal testing installations, etc.  When disabled, the respective
-files are not downloaded at all.
+This can be disabled (set to 0) if disk space is (very) limited.
 
    The options 'autobackup' and 'backupdir' determine the defaults for
 the actions 'update', 'backup' and 'restore'.  These three actions need
@@ -3345,8 +3119,7 @@
 no backups are removed.  If 'autobackup' is 0 or more, it specifies the
 number of backups to keep.  Thus, backups are disabled if the value is
 0.  In the '--clean' mode of the 'backup' action this option also
-specifies the number to be kept.  The default value is 1, so that
-backups are made, but only one backup is kept.
+specifies the number to be kept.
 
    To setup 'autobackup' to '-1' on the command line, use:
 
@@ -3360,7 +3133,7 @@
 Unix-like systems to control the generation of links for executables,
 info files and man pages.  See the 'path' action for details.
 
-   The last three options also affect behavior on Windows installations.
+   The last three options control behaviour on Windows installations.
 If 'desktop_integration' is set, then some packages will install items
 in a sub-folder of the Start menu for 'tlmgr gui', documentation, etc.
 If 'fileassocs' is set, Windows file associations are made (see also the
@@ -3371,7 +3144,7 @@
 
 File: tlbuild.info,  Node: tlmgr paper,  Next: tlmgr path [--w32mode=user|admin] [add|remove],  Prev: tlmgr option,  Up: tlmgr ACTIONS
 
-B.6.16 paper
+B.6.14 paper
 ------------
 
 *paper [a4|letter]*
@@ -3405,7 +3178,7 @@
 
 File: tlbuild.info,  Node: tlmgr path [--w32mode=user|admin] [add|remove],  Next: tlmgr pinning,  Prev: tlmgr paper,  Up: tlmgr ACTIONS
 
-B.6.17 path [-w32mode=user|admin] [add|remove]
+B.6.15 path [-w32mode=user|admin] [add|remove]
 ----------------------------------------------
 
 On Unix, merely adds or removes symlinks for binaries, man pages, and
@@ -3436,7 +3209,7 @@
 
 File: tlbuild.info,  Node: tlmgr pinning,  Next: tlmgr platform list|add|remove _platform_...,  Prev: tlmgr path [--w32mode=user|admin] [add|remove],  Up: tlmgr ACTIONS
 
-B.6.18 pinning
+B.6.16 pinning
 --------------
 
 The 'pinning' action manages the pinning file, see *note Pinning: tlmgr
@@ -3463,19 +3236,19 @@
 
 File: tlbuild.info,  Node: tlmgr platform list|add|remove _platform_...,  Next: tlmgr platform set _platform_,  Prev: tlmgr pinning,  Up: tlmgr ACTIONS
 
-B.6.19 platform list|add|remove _platform_...
+B.6.17 platform list|add|remove _platform_...
 ---------------------------------------------
 
 
 File: tlbuild.info,  Node: tlmgr platform set _platform_,  Next: tlmgr platform set auto,  Prev: tlmgr platform list|add|remove _platform_...,  Up: tlmgr ACTIONS
 
-B.6.20 platform set _platform_
+B.6.18 platform set _platform_
 ------------------------------
 
 
 File: tlbuild.info,  Node: tlmgr platform set auto,  Next: tlmgr postaction [--w32mode=user|admin] [--fileassocmode=1|2] [--all] [install|remove] [shortcut|fileassoc|script] [_pkg_]...,  Prev: tlmgr platform set _platform_,  Up: tlmgr ACTIONS
 
-B.6.21 platform set auto
+B.6.19 platform set auto
 ------------------------
 
 'platform list' lists the TeX Live names of all the platforms (a.k.a.
@@ -3510,7 +3283,7 @@
 
 File: tlbuild.info,  Node: tlmgr postaction [--w32mode=user|admin] [--fileassocmode=1|2] [--all] [install|remove] [shortcut|fileassoc|script] [_pkg_]...,  Next: tlmgr print-platform,  Prev: tlmgr platform set auto,  Up: tlmgr ACTIONS
 
-B.6.22 postaction [-w32mode=user|admin] [-fileassocmode=1|2] [-all] [install|remove] [shortcut|fileassoc|script] [_pkg_]...
+B.6.20 postaction [-w32mode=user|admin] [-fileassocmode=1|2] [-all] [install|remove] [shortcut|fileassoc|script] [_pkg_]...
 ---------------------------------------------------------------------------------------------------------------------------
 
 Carry out the postaction 'shortcut', 'fileassoc', or 'script' given as
@@ -3530,9 +3303,9 @@
 'option fileassocs'.)
 
 
-File: tlbuild.info,  Node: tlmgr print-platform,  Next: tlmgr remove [_option_]... _pkg_...,  Prev: tlmgr postaction [--w32mode=user|admin] [--fileassocmode=1|2] [--all] [install|remove] [shortcut|fileassoc|script] [_pkg_]...,  Up: tlmgr ACTIONS
+File: tlbuild.info,  Node: tlmgr print-platform,  Next: tlmgr restore [--backupdir _dir_] [--all | _pkg_ [_rev_]],  Prev: tlmgr postaction [--w32mode=user|admin] [--fileassocmode=1|2] [--all] [install|remove] [shortcut|fileassoc|script] [_pkg_]...,  Up: tlmgr ACTIONS
 
-B.6.23 print-platform
+B.6.21 print-platform
 ---------------------
 
 Print the TeX Live identifier for the detected platform
@@ -3540,43 +3313,61 @@
 '--print-arch' is a synonym.
 
 
-File: tlbuild.info,  Node: tlmgr remove [_option_]... _pkg_...,  Next: tlmgr repository,  Prev: tlmgr print-platform,  Up: tlmgr ACTIONS
+File: tlbuild.info,  Node: tlmgr restore [--backupdir _dir_] [--all | _pkg_ [_rev_]],  Next: tlmgr remove [_option_]... _pkg_...,  Prev: tlmgr print-platform,  Up: tlmgr ACTIONS
 
-B.6.24 remove [_option_]... _pkg_...
-------------------------------------
+B.6.22 restore [-backupdir _dir_] [-all | _pkg_ [_rev_]]
+--------------------------------------------------------
 
-Remove each _pkg_ specified.  Removing a collection removes all package
-dependencies (unless '--no-depends' is specified), but not any
-collection dependencies of that collection.  However, when removing a
-package, dependencies are never removed.  Options:
+Restore a package from a previously-made backup.
 
-*-backup*
+   If '--all' is given, try to restore the latest revision of all
+package backups found in the backup directory.
 
+   Otherwise, if neither _pkg_ nor _rev_ are given, list the available
+backup revisions for all packages.
+
+   With _pkg_ given but no _rev_, list all available backup revisions of
+_pkg_.
+
+   When listing available packages tlmgr shows the revision and in
+parenthesis the creation time if available (in format yyyy-mm-dd hh:mm).
+
+   With both _pkg_ and _rev_, tries to restore the package from the
+specified backup.
+
+   Options:
+
+*-all*
+
+     Try to restore the latest revision of all package backups found in
+     the backup directory.  Additional non-option arguments (like _pkg_)
+     are not allowed.
+
 *-backupdir* _directory_
 
-     These options behave just as with the *note (update)tlmgr update
-     [_option_]... [_pkg_]...:: action (q.v.), except they apply to
-     making backups of packages before they are removed.  The default is
-     to make such a backup, that is, to save a copy of packages before
-     removal.
+     Specify the directory where the backups are to be found.  If not
+     given it will be taken from the configuration setting in the TLPDB.
 
-     See *note (update)tlmgr update [_option_]... [_pkg_]...:: action
-     for more.
+*-dry-run*
 
-     neither option is given, no backup will be made.  If '--backupdir'
-     is given and specifies a writable directory then a backup will be
-     made in that location.  If only '--backup' is given, then a backup
-     will be made to the directory previously set via the 'option'
-     action (see below).  If both are given then a backup will be made
-     to the specified _directory_.
+     Nothing is actually restored; instead, the actions to be performed
+     are written to the terminal.
 
-     You can set options via the 'option' action to automatically make
-     backups for all packages, and/or keep only a certain number of
-     backups.  Please see the 'option' action for details.  The default
-     is to make one backup.
+*-force*
 
-     The 'restore' action explains how to restore from a backup.
+     Don't ask questions.
 
+
+File: tlbuild.info,  Node: tlmgr remove [_option_]... _pkg_...,  Next: tlmgr repository,  Prev: tlmgr restore [--backupdir _dir_] [--all | _pkg_ [_rev_]],  Up: tlmgr ACTIONS
+
+B.6.23 remove [_option_]... _pkg_...
+------------------------------------
+
+Remove each _pkg_ specified.  Removing a collection removes all package
+dependencies (unless '--no-depends' is specified), but not any
+collection dependencies of that collection.  However, when removing a
+package, dependencies are never removed.  Options:
+
 *-no-depends*
 
      Do not remove dependent packages.
@@ -3602,9 +3393,9 @@
      are written to the terminal.
 
 
-File: tlbuild.info,  Node: tlmgr repository,  Next: tlmgr restore [--backupdir _dir_] [--all | _pkg_ [_rev_]],  Prev: tlmgr remove [_option_]... _pkg_...,  Up: tlmgr ACTIONS
+File: tlbuild.info,  Node: tlmgr repository,  Next: tlmgr search [_option_...] _what_,  Prev: tlmgr remove [_option_]... _pkg_...,  Up: tlmgr ACTIONS
 
-B.6.25 repository
+B.6.24 repository
 -----------------
 
 *repository list*
@@ -3639,85 +3430,62 @@
      otherwise, all operations will fail!
 
 
-File: tlbuild.info,  Node: tlmgr restore [--backupdir _dir_] [--all | _pkg_ [_rev_]],  Next: tlmgr search [_option_...] _what_,  Prev: tlmgr repository,  Up: tlmgr ACTIONS
+File: tlbuild.info,  Node: tlmgr search [_option_...] _what_,  Next: tlmgr uninstall,  Prev: tlmgr repository,  Up: tlmgr ACTIONS
 
-B.6.26 restore [-backupdir _dir_] [-all | _pkg_ [_rev_]]
---------------------------------------------------------
+B.6.25 search [_option_...] _what_
+----------------------------------
 
-Restore a package from a previously-made backup.
+* Menu:
 
-   If '--all' is given, try to restore the latest revision of all
-package backups found in the backup directory.
+* tlmgr search [_option_...] --file _what_::
+* tlmgr search [_option_...] --taxonomy _what_::
+* tlmgr search [_option_...] --keyword _what_::
+* tlmgr search [_option_...] --functionality _what_::
+* tlmgr search [_option_...] --characterization _what_::
+* tlmgr search [_option_...] --all _what_::
 
-   Otherwise, if neither _pkg_ nor _rev_ are given, list the available
-backup revisions for all packages.  With _pkg_ given but no _rev_, list
-all available backup revisions of _pkg_.
+
+File: tlbuild.info,  Node: tlmgr search [_option_...] --file _what_,  Next: tlmgr search [_option_...] --taxonomy _what_,  Up: tlmgr search [_option_...] _what_
 
-   When listing available packages, 'tlmgr' shows the revision, and in
-parenthesis the creation time if available (in format yyyy-mm-dd hh:mm).
+B.6.25.1 search [_option_...] -file _what_
+..........................................
 
-   If (and only if) both _pkg_ and a valid revision number _rev_ are
-specified, try to restore the package from the specified backup.
+
+File: tlbuild.info,  Node: tlmgr search [_option_...] --taxonomy _what_,  Next: tlmgr search [_option_...] --keyword _what_,  Prev: tlmgr search [_option_...] --file _what_,  Up: tlmgr search [_option_...] _what_
 
-   Options:
+B.6.25.2 search [_option_...] -taxonomy _what_
+..............................................
 
-*-all*
+
+File: tlbuild.info,  Node: tlmgr search [_option_...] --keyword _what_,  Next: tlmgr search [_option_...] --functionality _what_,  Prev: tlmgr search [_option_...] --taxonomy _what_,  Up: tlmgr search [_option_...] _what_
 
-     Try to restore the latest revision of all package backups found in
-     the backup directory.  Additional non-option arguments (like _pkg_)
-     are not allowed.
+B.6.25.3 search [_option_...] -keyword _what_
+.............................................
 
-*-backupdir* _directory_
-
-     Specify the directory where the backups are to be found.  If not
-     given it will be taken from the configuration setting in the TLPDB.
-
-*-dry-run*
-
-     Nothing is actually restored; instead, the actions to be performed
-     are written to the terminal.
-
-*-force*
-
-     Don't ask questions.
-
 
-File: tlbuild.info,  Node: tlmgr search [_option_...] _what_,  Next: tlmgr shell,  Prev: tlmgr restore [--backupdir _dir_] [--all | _pkg_ [_rev_]],  Up: tlmgr ACTIONS
+File: tlbuild.info,  Node: tlmgr search [_option_...] --functionality _what_,  Next: tlmgr search [_option_...] --characterization _what_,  Prev: tlmgr search [_option_...] --keyword _what_,  Up: tlmgr search [_option_...] _what_
 
-B.6.27 search [_option_...] _what_
-----------------------------------
+B.6.25.4 search [_option_...] -functionality _what_
+...................................................
 
-* Menu:
-
-* tlmgr search [_option_...] --file _what_::
-* tlmgr search [_option_...] --all _what_::
-
 
-File: tlbuild.info,  Node: tlmgr search [_option_...] --file _what_,  Next: tlmgr search [_option_...] --all _what_,  Up: tlmgr search [_option_...] _what_
+File: tlbuild.info,  Node: tlmgr search [_option_...] --characterization _what_,  Next: tlmgr search [_option_...] --all _what_,  Prev: tlmgr search [_option_...] --functionality _what_,  Up: tlmgr search [_option_...] _what_
 
-B.6.27.1 search [_option_...] -file _what_
-..........................................
+B.6.25.5 search [_option_...] -characterization _what_
+......................................................
 
 
-File: tlbuild.info,  Node: tlmgr search [_option_...] --all _what_,  Prev: tlmgr search [_option_...] --file _what_,  Up: tlmgr search [_option_...] _what_
+File: tlbuild.info,  Node: tlmgr search [_option_...] --all _what_,  Prev: tlmgr search [_option_...] --characterization _what_,  Up: tlmgr search [_option_...] _what_
 
-B.6.27.2 search [_option_...] -all _what_
+B.6.25.6 search [_option_...] -all _what_
 .........................................
 
 By default, search the names, short descriptions, and long descriptions
 of all locally installed packages for the argument _what_, interpreted
-as a (Perl) regular expression.
+as a regular expression.
 
    Options:
 
-*-file*
-
-     List all filenames containing _what_.
-
-*-all*
-
-     Search everything: package names, descriptions and filenames.
-
 *-global*
 
      Search the TeX Live Database of the installation medium, instead of
@@ -3725,76 +3493,45 @@
 
 *-word*
 
-     Restrict the search of package names and descriptions (but not
-     filenames) to match only full words.  For example, searching for
-     'table' with this option will not output packages containing the
-     word 'tables' (unless they also contain the word 'table' on its
-     own).
+     Restrict the search to match only full words.  For example,
+     searching for 'table' with this option will not output packages
+     containing the word 'tables' (unless they also contain the word
+     'table' on its own).
 
-
-File: tlbuild.info,  Node: tlmgr shell,  Next: tlmgr uninstall,  Prev: tlmgr search [_option_...] _what_,  Up: tlmgr ACTIONS
+*-list*
 
-B.6.28 shell
-------------
+     If a search for any (or all) taxonomies is done, by specifying one
+     of the taxonomy options below, then instead of searching for
+     packages, list the entire corresponding taxonomy (or all of them).
+     See *note TAXONOMIES: tlmgr TAXONOMIES. below.
 
-Starts an interactive mode, where tlmgr prompts for commands.  This can
-be used directly, or for scripting.  The first line of output is
-'protocol' _n_, where _n_ is an unsigned number identifying the protocol
-version (currently 1).
+   Other search options are selected by specifying one of the following:
 
-   In general, tlmgr actions that can be given on the command line
-translate to commands in this shell mode.  For example, you can say
-'update --list' to see what would be updated.  The TLPDB is loaded the
-first time it is needed (not at the beginning), and used for the rest of
-the session.
+*-file*
 
-   Besides these actions, a few commands are specific to shell mode:
+     List all filenames containing _what_.
 
-protocol
+*-taxonomy*
 
-     Print 'protocol _n_', the current protocol version.
+*-keyword*
 
-help
+*-functionality*
 
-     Print pointers to this documentation.
+*-characterization*
 
-version
+     Search in the corresponding taxonomy (or all) instead of the
+     package descriptions.  See *note TAXONOMIES: tlmgr TAXONOMIES.
+     below.
 
-     Print tlmgr version information.
+*-all*
 
-quit, end, bye, byebye, EOF
+     Search for package names, descriptions, and taxonomies, but not
+     files.
 
-     Exit.
-
-restart
-
-     Restart 'tlmgr shell' with the original command line; most useful
-     when developing 'tlmgr'.
-
-load [local|remote]
-
-     Explicitly load the local or remote, respectively, TLPDB.
-
-save
-
-     Save the local TLPDB, presumably after other operations have
-     changed it.
-
-get [_var_] =item set [_var_ [_val_]]
-
-     Get the value of _var_, or set it to _val_.  Possible _var_ names:
-     'debug-translation', 'machine-readable', 'no-execute-actions',
-     'require-verification', 'verify-downloads', and 'repository'.  All
-     except 'repository' are booleans, taking values 0 and 1, and behave
-     like the corresponding command line option.  The 'repository'
-     variable takes a string, and sets the remote repository location.
-
-     If _var_ or then _val_ is not specified, it is prompted for.
-
 
-File: tlbuild.info,  Node: tlmgr uninstall,  Next: tlmgr update [_option_]... [_pkg_]...,  Prev: tlmgr shell,  Up: tlmgr ACTIONS
+File: tlbuild.info,  Node: tlmgr uninstall,  Next: tlmgr update [_option_]... [_pkg_]...,  Prev: tlmgr search [_option_...] _what_,  Up: tlmgr ACTIONS
 
-B.6.29 uninstall
+B.6.26 uninstall
 ----------------
 
 Uninstalls the entire TeX Live installation.  Options:
@@ -3806,7 +3543,7 @@
 
 File: tlbuild.info,  Node: tlmgr update [_option_]... [_pkg_]...,  Prev: tlmgr uninstall,  Up: tlmgr ACTIONS
 
-B.6.30 update [_option_]... [_pkg_]...
+B.6.27 update [_option_]... [_pkg_]...
 --------------------------------------
 
 Updates the packages given as arguments to the latest version available
@@ -3945,31 +3682,29 @@
 
        tlmgr update --reinstall-forcibly-removed --all
 
-*-backup*
+*-backup* and *-backupdir* _directory_
 
-*-backupdir* _directory_
-
      These two options control the creation of backups of packages
      _before_ updating; that is, backup of packages as currently
-     installed.  If neither options is given, no backup will made saved.
-     If '--backupdir' is given and specifies a writable directory then a
-     backup will be made in that location.  If only '--backup' is given,
-     then a backup will be made to the directory previously set via the
-     *note option: tlmgr option. action (see below).  If both are given
-     then a backup will be made to the specified _directory_.
+     installed.  If neither of these options are given, no backup
+     package will be saved.  If '--backupdir' is given and specifies a
+     writable directory then a backup will be made in that location.  If
+     only '--backup' is given, then a backup will be made to the
+     directory previously set via the 'option' action (see below).  If
+     both are given then a backup will be made to the specified
+     _directory_.
 
-     You can also set options via the '/option' action to automatically
-     make backups for all packages, and/or keep only a certain number of
-     backups.
+     You can set options via the 'option' action to automatically create
+     backups for all packages, and/or keep only a certain number of
+     backups.  Please see the 'option' action for details.
 
      'tlmgr' always makes a temporary backup when updating packages, in
      case of download or other failure during an update.  In contrast,
-     the purpose of this '--backup' option is to save a persistent
-     backup in case the actual _content_ of the update causes problems,
-     e.g., introduces an TeX incompatibility.
+     the purpose of this '--backup' option is to allow you to save a
+     persistent backup in case the actual _content_ of the update causes
+     problems, e.g., introduces an incompatibility.
 
-     The *note restore: tlmgr restore [--backupdir _dir_] [--all | _pkg_
-     [_rev_]]. action explains how to restore from a backup.
+     The 'restore' action explains how to restore from a backup.
 
 *-no-depends*
 
@@ -3993,134 +3728,10 @@
 not downgrade.  Also, packages for uninstalled platforms are not
 installed.
 
-   'tlmgr' saves a copy of the 'texlive.tlpdb' file used for an update
-with a suffix representing the repository url, as in
-'tlpkg/texlive.tlpdb.'_long-hash-string_.  These can be useful for
-fallback information, but if you don't like them accumulating (e.g.,
-'mirror.ctan.org' resolves to many different hosts, each resulting in a
-possibly different hash), it's harmless to delete them.
-
 
-File: tlbuild.info,  Node: tlmgr CONFIGURATION FILE FOR TLMGR,  Next: tlmgr CRYPTOGRAPHIC VERIFICATION,  Prev: tlmgr ACTIONS,  Up: tlmgr
+File: tlbuild.info,  Node: tlmgr USER MODE,  Next: tlmgr CONFIGURATION FILE FOR TLMGR,  Prev: tlmgr ACTIONS,  Up: tlmgr
 
-B.7 CONFIGURATION FILE FOR TLMGR
-================================
-
-There are two configuration files for 'tlmgr': One is system-wide in
-'TEXMFSYSCONFIG/tlmgr/config', and the other is user-specific in
-'TEXMFCONFIG/tlmgr/config'.  The user-specific one is the default for
-the 'conf tlmgr' action.  (Run 'kpsewhich -var-value=TEXMFSYSCONFIG' or
-'... TEXMFCONFIG ...' to see the actual directory names.)
-
-   A few defaults corresponding to command-line options can be set in
-these configuration files.  In addition, the system-wide file can
-contain a directive to restrict the allowed actions.
-
-   In these config files, empty lines and lines starting with # are
-ignored.  All other lines must look like:
-
-  key = value
-
-   where the spaces are optional but the '=' is required.
-
-   The allowed keys are:
-
-'auto-remove', value 0 or 1 (default 1), same as command-line option.
-
-'gui-expertmode', value 0 or 1 (default 1). This switches between the full GUI and a simplified GUI with only the most common settings.
-
-'gui-lang' _llcode_, with a language code value as with the command-line option.
-
-'no-checksums', value 0 or 1 (default 0, see below).
-
-'persistent-downloads', value 0 or 1 (default 1), same as command-line option.
-
-'require-verification', value 0 or 1 (default 0), same as command-line option.
-
-'verify-downloads', value 0 or 1 (default 1), same as command-line option.
-
-   The system-wide config file can contain one additional key:
-
-'allowed-actions' _action1_ [,_action_,...] The value is a comma-separated list of 'tlmgr' actions which are allowed to be executed when 'tlmgr' is invoked in system mode (that is, without '--usermode').
-
-     This allows distributors to include the 'tlmgr' in their packaging,
-     but allow only a restricted set of actions that do not interfere
-     with their distro package manager.  For native TeX Live
-     installations, it doesn't make sense to set this.
-
-   The 'no-checksums' key needs more explanation.  By default, package
-checksums computed and stored on the server (in the TLPDB) are compared
-to checksums computed locally after downloading.  That is, for each
-'texlive.tlpdb' loaded from a repository, the corresponding checksum
-file 'texlive.tlpdb.sha512' is also downloaded, and 'tlmgr' confirms
-whether the checksum of the downloaded TLPDB file agrees with the
-download data.  'no-checksums' disables this process.
-
-   The checksum algorithm is SHA-512.  Your system must have one of
-(looked for in this order) the Perl 'Digest::SHA' module, the 'openssl'
-program (<http://openssl.org>), the 'sha512sum' program (from GNU
-Coreutils, <http://www.gnu.org/software/coreutils>), or finally the
-'shasum' program (just to support old Macs).  If none of these are
-available, a warning is issued and 'tlmgr' proceeds without checking
-checksums.  (Incidentally, other SHA implementations, such as the pure
-Perl and pure Lua modules, are much too slow to be usable in our
-context.)  'no-checksums' avoids the warning.
-
-
-File: tlbuild.info,  Node: tlmgr CRYPTOGRAPHIC VERIFICATION,  Next: tlmgr USER MODE,  Prev: tlmgr CONFIGURATION FILE FOR TLMGR,  Up: tlmgr
-
-B.8 CRYPTOGRAPHIC VERIFICATION
-==============================
-
-'tlmgr' and 'install-tl' perform cryptographic verification if possible.
-If verification is performed and successful, the programs report
-'(verified)' after loading the TLPDB; otherwise, they report '(not
-verified)'.  Either way, by default the installation and/or updates
-proceed normally.
-
-   The attempted verification can be suppressed by specifying
-'--no-verify-downloads' on the command line, or the entry
-'verify-downloads = 0' in a 'tlmgr' config file (described in *note
-CONFIGURATION FILE FOR TLMGR: tlmgr CONFIGURATION FILE FOR TLMGR.). On
-the other hand, it is possible to _require_ verification by specifying
-'--require-verification' on the command line, or 'require-verification =
-1' in a 'tlmgr' config file; in this case, if verification is not
-possible, the program quits.
-
-   Cryptographic verification requires checksum checking (described just
-above) to succeed, and a working GnuPG ('gpg') program (see below for
-search method).  Then, unless cryptographic verification has been
-disabled, a signature file ('texlive.tlpdb.*.asc') of the checksum file
-is downloaded and the signature verified.  The signature is created by
-the TeX Live Distribution GPG key 0x06BAB6BC, which in turn is signed by
-Karl Berry's key 0x30D155AD and Norbert Preining's key 0x6CACA448.  All
-of these keys are obtainable from the standard key servers.
-
-   Additional trusted keys can be added using the 'key' action.
-
-* Menu:
-
-* tlmgr Configuration of GnuPG invocation::
-
-
-File: tlbuild.info,  Node: tlmgr Configuration of GnuPG invocation,  Up: tlmgr CRYPTOGRAPHIC VERIFICATION
-
-B.8.1 Configuration of GnuPG invocation
----------------------------------------
-
-The executable used for GnuPG is searched as follows: If the environment
-variable 'TL_GNUPG' is set, it is tested and used; otherwise 'gpg' is
-checked; finally 'gpg2' is checked.
-
-   Further adaptation of the 'gpg' invocation can be made using the two
-environment variables 'TL_GNUPGHOME', which is passed to 'gpg' as the
-value for '--homedir', and 'TL_GNUPGARGS', which replaces the default
-options '--no-secmem-warning --no-permission-warning'.
-
-
-File: tlbuild.info,  Node: tlmgr USER MODE,  Next: tlmgr MULTIPLE REPOSITORIES,  Prev: tlmgr CRYPTOGRAPHIC VERIFICATION,  Up: tlmgr
-
-B.9 USER MODE
+B.7 USER MODE
 =============
 
 'tlmgr' provides a restricted way, called "user mode", to manage
@@ -4176,14 +3787,14 @@
 
 * Menu:
 
-* tlmgr User mode install::
-* tlmgr User mode backup, restore, remove, update::
-* tlmgr User mode generate, option, paper::
+* tlmgr user mode install::
+* tlmgr user mode backup; restore; remove; update::
+* tlmgr user mode generate; option; paper::
 
 
-File: tlbuild.info,  Node: tlmgr User mode install,  Next: tlmgr User mode backup, restore, remove, update,  Up: tlmgr USER MODE
+File: tlbuild.info,  Node: tlmgr user mode install,  Next: tlmgr user mode backup; restore; remove; update,  Up: tlmgr USER MODE
 
-B.9.1 User mode install
+B.7.1 user mode install
 -----------------------
 
 In user mode, the 'install' action checks that the package and all
@@ -4200,14 +3811,10 @@
 collections, while in user mode, _only_ the packages mentioned in
 'collection-context' are installed.
 
-   If a package shipping map files is installed in user mode, a backup
-of the user's 'updmap.cfg' in 'USERTREE/web2c/' is made, and then this
-file regenerated from the list of installed packages.
-
 
-File: tlbuild.info,  Node: tlmgr User mode backup, restore, remove, update,  Next: tlmgr User mode generate, option, paper,  Prev: tlmgr User mode install,  Up: tlmgr USER MODE
+File: tlbuild.info,  Node: tlmgr user mode backup; restore; remove; update,  Next: tlmgr user mode generate; option; paper,  Prev: tlmgr user mode install,  Up: tlmgr USER MODE
 
-B.9.2 User mode backup, restore, remove, update
+B.7.2 user mode backup; restore; remove; update
 -----------------------------------------------
 
 In user mode, these actions check that all packages to be acted on are
@@ -4215,9 +3822,9 @@
 just as in normal mode.
 
 
-File: tlbuild.info,  Node: tlmgr User mode generate, option, paper,  Prev: tlmgr User mode backup, restore, remove, update,  Up: tlmgr USER MODE
+File: tlbuild.info,  Node: tlmgr user mode generate; option; paper,  Prev: tlmgr user mode backup; restore; remove; update,  Up: tlmgr USER MODE
 
-B.9.3 User mode generate, option, paper
+B.7.3 user mode generate; option; paper
 ---------------------------------------
 
 In user mode, these actions operate only on the user tree's
@@ -4225,8 +3832,79 @@
 in user tree
 
 
-File: tlbuild.info,  Node: tlmgr MULTIPLE REPOSITORIES,  Next: tlmgr GUI FOR TLMGR,  Prev: tlmgr USER MODE,  Up: tlmgr
+File: tlbuild.info,  Node: tlmgr CONFIGURATION FILE FOR TLMGR,  Next: tlmgr TAXONOMIES,  Prev: tlmgr USER MODE,  Up: tlmgr
 
+B.8 CONFIGURATION FILE FOR TLMGR
+================================
+
+A small subset of the command line options can be set in a config file
+for 'tlmgr' which resides in 'TEXMFCONFIG/tlmgr/config'.  By default,
+the config file is in '~/.texliveYYYY/texmf-config/tlmgr/config'
+(replacing 'YYYY' with the year of your TeX Live installation).  This is
+_not_ 'TEXMFSYSVAR', so that the file is specific to a single user.
+
+   In this file, empty lines and lines starting with # are ignored.  All
+other lines must look like
+
+  key = value
+
+   where the allowed keys are 'gui-expertmode' (value 0 or 1),
+'persistent-downloads' (value 0 or 1), 'auto-remove' (value 0 or 1), and
+'gui-lang' (value like in the command line option).
+
+   'persistent-downloads', 'gui-lang', and 'auto-remove' correspond to
+the respective command line options of the same name.  'gui-expertmode'
+switches between the full GUI and a simplified GUI with only the
+important and mostly used settings.
+
+
+File: tlbuild.info,  Node: tlmgr TAXONOMIES,  Next: tlmgr MULTIPLE REPOSITORIES,  Prev: tlmgr CONFIGURATION FILE FOR TLMGR,  Up: tlmgr
+
+B.9 TAXONOMIES
+==============
+
+tlmgr allows searching and listing of various categorizations, which we
+call _taxonomies_, as provided by an enhanced TeX Catalogue (available
+for testing at <http://az.ctan.org>).  This is useful when, for example,
+you don't know a specific package name but have an idea of the
+functionality you need; or when you want to see all packages relating to
+a given area.
+
+   There are three different taxonomies, specified by the following
+options:
+
+'--keyword'
+
+     The keywords, as specified at <http://az.ctan.org/keyword>.
+
+'--functionality'
+
+     The "by-topic" categorization created by J\"urgen Fenn, as
+     specified at <http://az.ctan.org/characterization/by-function>.
+
+'--characterization'
+
+     Both the primary and secondary functionalities, as specified at
+     <http://az.ctan.org/characterization/choose_dimen>.
+
+'--taxonomy'
+
+     Operate on all the taxonomies.
+
+   The taxonomies are updated nightly and stored within TeX Live, so
+Internet access is not required to search them.
+
+   Examples:
+
+  tlmgr search --taxonomy exercise      # check all taxonomies for "exercise"
+  tlmgr search --taxonomy --word table  # check for "table" on its own
+  tlmgr search --list --keyword         # dump entire keyword taxonomy
+  tlmgr show --taxonomy pdftex          # show pdftex package information,
+                                        #   including all taxonomy entries
+
+
+File: tlbuild.info,  Node: tlmgr MULTIPLE REPOSITORIES,  Next: tlmgr GUI FOR TLMGR,  Prev: tlmgr TAXONOMIES,  Up: tlmgr
+
 B.10 MULTIPLE REPOSITORIES
 ==========================
 
@@ -4240,11 +3918,11 @@
 installation source to any repository (with the '-repository' or 'option
 repository' command line options), and perform your operations.
 
-   When you are using multiple repositories over a sustained length of
-time, however, explicitly switching between them becomes inconvenient.
-Thus, it's possible to tell 'tlmgr' about additional repositories you
-want to use.  The basic command is 'tlmgr repository add'.  The rest of
-this section explains further.
+   When you are using multiple repositories over a sustained time,
+however, explicitly switching between them becomes inconvenient.  Thus,
+it's possible to tell 'tlmgr' about additional repositories you want to
+use.  The basic command is 'tlmgr repository add'.  The rest of this
+section explains further.
 
    When using multiple repositories, one of them has to be set as the
 main repository, which distributes most of the installed packages.  When
@@ -4335,17 +4013,15 @@
 B.11 GUI FOR TLMGR
 ==================
 
-The graphical user interface for 'tlmgr' requires Perl/Tk
-<http://search.cpan.org/search?query=perl%2Ftk>.  For Windows the
-necessary modules are shipped within TeX Live, for all other (i.e.,
-Unix-based) systems Perl/Tk (as well as Perl of course) has to be
-installed outside of TL. <http://tug.org/texlive/distro.html#perltk> has
-a list of invocations for some distros.
+The graphical user interface for 'tlmgr' needs Perl/Tk to be installed.
+For Windows the necessary modules are shipped within TeX Live, for all
+other (i.e., Unix-based) systems Perl/Tk (as well as Perl of course) has
+to be installed.  <http://tug.org/texlive/distro.html#perltk> has a list
+of invocations for some distros.
 
-   The GUI is started with the invocation 'tlmgr gui'; assuming Tk is
-loadable, the graphical user interface will be shown.  The main window
-contains a menu bar, the main display, and a status area where messages
-normally shown on the console are displayed.
+   When started with 'tlmgr gui' the graphical user interface will be
+shown.  The main window contains a menu bar, the main display, and a
+status area where messages normally shown on the console are displayed.
 
    Within the main display there are three main parts: the 'Display
 configuration' area, the list of packages, and the action buttons.
@@ -4361,7 +4037,6 @@
 
 * tlmgr Main display::
 * tlmgr Menu bar::
-* tlmgr GUI options::
 
 
 File: tlbuild.info,  Node: tlmgr Main display,  Next: tlmgr Menu bar,  Up: tlmgr GUI FOR TLMGR
@@ -4400,8 +4075,9 @@
 Match
 
      Select packages matching for a specific pattern.  By default, this
-     searches both descriptions and filenames.  You can also select a
-     subset for searching.
+     uses the same algorithm as 'tlmgr search', i.e., searches
+     everything: descriptions, taxonomies, and/or filenames.  You can
+     also select any subset for searching.
 
 Selection
 
@@ -4500,7 +4176,7 @@
      General>).
 
 
-File: tlbuild.info,  Node: tlmgr Menu bar,  Next: tlmgr GUI options,  Prev: tlmgr Main display,  Up: tlmgr GUI FOR TLMGR
+File: tlbuild.info,  Node: tlmgr Menu bar,  Prev: tlmgr Main display,  Up: tlmgr GUI FOR TLMGR
 
 B.11.2 Menu bar
 ---------------
@@ -4554,42 +4230,6 @@
      <http://tug.org/texlive/doc.html>) and the usual "About" box.
 
 
-File: tlbuild.info,  Node: tlmgr GUI options,  Prev: tlmgr Menu bar,  Up: tlmgr GUI FOR TLMGR
-
-B.11.3 GUI options
-------------------
-
-Some generic Perl/Tk options can be specified with 'tlmgr gui' to
-control the display:
-
-'-background' _color_
-
-     Set background color.
-
-'-font "' _fontname_ _fontsize_ '"'
-
-     Set font, e.g., 'tlmgr gui -font "helvetica 18"'.  The argument to
-     '-font' must be quoted, i.e., passed as a single string.
-
-'-foreground' _color_
-
-     Set foreground color.
-
-'-geometry' _geomspec_
-
-     Set the X geometry, e.g., 'tlmgr gui -geometry 1024x512-0+0'
-     creates the window of (approximately) the given size in the
-     upper-right corner of the display.
-
-'-xrm' _xresource_
-
-     Pass the arbitrary X resource string _xresource_.
-
-   A few other obscure options are recognized but not mentioned here.
-See the Perl/Tk documentation (<http://search.cpan.org/perldoc?Tk>) for
-the complete list, and any X documentation for general information.
-
-
 File: tlbuild.info,  Node: tlmgr MACHINE-READABLE OUTPUT,  Next: tlmgr AUTHORS AND COPYRIGHT,  Prev: tlmgr GUI FOR TLMGR,  Up: tlmgr
 
 B.12 MACHINE-READABLE OUTPUT
@@ -4754,8 +4394,6 @@
 distribution (<http://tug.org/texlive>) and both are licensed under the
 GNU General Public License Version 2 or later.
 
-   $Id: tlmgr.pl 44422 2017-05-19 15:07:25Z karl $
-
 
 File: tlbuild.info,  Node: Index,  Prev: tlmgr,  Up: Top
 
@@ -5316,325 +4954,297 @@
 Node: Distro builds19869
 Node: Layout and infrastructure22259
 Node: Build system tools23087
-Node: Top-level directories25096
-Node: Autoconf macros27510
-Node: General setup macros28211
-Node: Macros for programs29078
-Node: Macros for compilers29890
-Node: Macros for libraries31324
-Node: Macros for library and header flags31750
-Node: Macros for Windows33630
-Node: Library modules35207
-Node: png library35696
-Node: zlib library37970
-Node: freetype library38485
-Node: kpathsea library39013
-Node: Program modules40412
-Node: t1utils package40840
-Node: xindy package41391
-Node: xdvik package42541
-Node: asymptote43614
-Node: Extending TeX Live44065
-Node: Adding a new program module44842
-Node: Adding a new generic library module46361
-Node: Adding a new TeX-specific library module48574
-Node: Configure options49261
-Node: Global configure options50643
-Node: --disable-native-texlive-build51185
-Node: --prefix --bindir ...52175
-Node: --disable-largefile52715
-Node: --disable-missing53400
-Node: --enable-compiler-warnings=LEVEL53801
-Node: --enable-cxx-runtime-hack54540
-Node: --enable-maintainer-mode54967
-Node: --enable-multiplatform55496
-Node: --enable-shared56034
-Node: --enable-silent-rules56405
-Node: --without-ln-s56861
-Node: --without-x57212
-Node: Program-specific configure options57400
-Node: --enable-PROG --disable-PROG58043
-Node: --disable-all-pkgs58320
-Node: Configure options for texk/web2c59306
-Node: Configure options for texk/bibtex-x61824
-Node: Configure options for texk/dvipdfm-x62367
-Node: Configure options for texk/dvisvgm63140
-Node: Configure options for texk/texlive64026
-Node: Configure options for texk/xdvik64447
-Node: Configure options for utils/xindy65051
-Node: Library-specific configure options65952
-Node: Configure options for kpathsea66963
-Node: Configure options for system poppler67672
-Node: Variables for configure68463
-Node: Cross compilation69891
-Node: Cross configuring71190
-Node: Cross problems72863
-Node: Coding conventions74510
-Node: Declarations and definitions75237
-Node: Const77419
-Node: install-tl79282
-Node: install-tl NAME79647
-Node: install-tl SYNOPSIS79805
-Node: install-tl DESCRIPTION80063
-Node: install-tl REFERENCES81130
-Node: install-tl OPTIONS81656
-Ref: install-tl *-gui* [[=]_module_]81997
-Ref: install-tl text82207
-Ref: install-tl wizard82330
-Ref: install-tl perltk82484
-Ref: install-tl *-no-gui*82915
-Ref: install-tl *-lang* _llcode_82996
-Ref: install-tl *-repository* _url|path_83683
-Ref: install-tl *-select-repository*85563
-Ref: install-tl *-all-options*85999
-Ref: install-tl *-custom-bin* _path_86254
-Ref: install-tl *-debug-translation*87085
-Ref: install-tl *-force-platform* _platform_87304
-Ref: install-tl *-help*, *--help*, *-?*87548
-Ref: install-tl *-in-place*87955
-Ref: install-tl *-init-from-profile* _profile_file_88500
-Ref: install-tl *-logfile* _file_88720
-Ref: install-tl *-no-cls*89071
-Ref: install-tl *-non-admin*89205
-Ref: install-tl *-persistent-downloads*89310
-Ref: install-tl *-no-persistent-downloads*89338
-Ref: install-tl *-no-verify-downloads*89956
-Ref: install-tl *-portable*90317
-Ref: install-tl *-print-platform*90456
-Ref: install-tl *-profile* _profile_file_90654
-Ref: install-tl *-q*90834
-Ref: install-tl *-scheme* _scheme_90896
-Ref: install-tl *-v*91370
-Ref: install-tl *-version*, *--version*91525
-Node: install-tl PROFILES91656
-Ref: install-tl instopt_adjustpath (default 0 on Unix, 1 on Windows)94306
-Ref: install-tl instopt_adjustrepo (default 1)94382
-Ref: install-tl instopt_letter (default 0)94519
-Ref: install-tl instopt_portable (default 0)94610
-Ref: install-tl instopt_write18_restricted (default 1)94706
-Node: install-tl ENVIRONMENT VARIABLES96025
-Ref: install-tl TEXLIVE_INSTALL_ENV_NOCHECK96416
-Ref: install-tl TEXLIVE_INSTALL_NO_CONTEXT_CACHE96618
-Ref: install-tl TEXLIVE_INSTALL_NO_WELCOME96728
-Ref: install-tl TEXLIVE_INSTALL_PREFIX96849
-Ref: install-tl TEXLIVE_INSTALL_TEXDIR96875
-Ref: install-tl TEXLIVE_INSTALL_TEXMFCONFIG96906
-Ref: install-tl TEXLIVE_INSTALL_TEXMFVAR96934
-Ref: install-tl TEXLIVE_INSTALL_TEXMFHOME96963
-Ref: install-tl TEXLIVE_INSTALL_TEXMFLOCAL96993
-Ref: install-tl TEXLIVE_INSTALL_TEXMFSYSCONFIG97027
-Ref: install-tl TEXLIVE_INSTALL_TEXMFSYSVAR97058
-Ref: install-tl NOPERLDOC97429
-Node: install-tl AUTHORS AND COPYRIGHT97493
-Node: tlmgr97905
-Node: tlmgr NAME98358
-Node: tlmgr SYNOPSIS98490
-Node: tlmgr DESCRIPTION98680
-Node: tlmgr EXAMPLES99776
-Ref: tlmgr tlmgr option repository ctan100027
-Ref: tlmgr tlmgr option repository http://mirror.ctan.org/systems/texlive/tlnet100099
-Ref: tlmgr tlmgr update --list100551
-Ref: tlmgr tlmgr update --all100644
-Ref: tlmgr tlmgr info _what_100801
-Node: tlmgr OPTIONS101063
-Ref: tlmgr *--repository* _url|path_101583
-Ref: tlmgr *--gui* [_action_]102308
-Ref: tlmgr *--gui-lang* _llcode_102715
-Ref: tlmgr *--debug-translation*103398
-Ref: tlmgr *--machine-readable*103601
-Ref: tlmgr *--no-execute-actions*103869
-Ref: tlmgr *--package-logfile* _file_104062
-Ref: tlmgr *--pause*104316
-Ref: tlmgr *--persistent-downloads*104471
-Ref: tlmgr *--no-persistent-downloads*104499
-Ref: tlmgr *--pin-file*104993
-Ref: tlmgr *--require-verification*105223
-Ref: tlmgr *--no-require-verification*105251
-Ref: tlmgr *--usermode*105487
-Ref: tlmgr *--usertree* _dir_105607
-Ref: tlmgr *--verify-downloads*105722
-Ref: tlmgr *--no-verify-downloads*105746
-Node: tlmgr ACTIONS106499
-Node: tlmgr help107883
-Node: tlmgr version108359
-Node: tlmgr backup [--clean[=_N_]] [--backupdir _dir_] [--all | _pkg_]...108677
-Ref: tlmgr *--backupdir* _directory_109771
-Ref: tlmgr *--all*109968
-Ref: tlmgr *--clean*[=_N_]110190
-Ref: tlmgr *--dry-run*110487
-Node: tlmgr candidates _pkg_110607
-Ref: tlmgr *candidates _pkg_* 1110894
-Node: tlmgr check [_option_]... [files|depends|executes|runfiles|all]111038
-Ref: tlmgr *files*111481
-Ref: tlmgr *depends*111616
-Ref: tlmgr *executes*111958
-Ref: tlmgr *runfiles*112076
-Ref: tlmgr *--use-svn*112197
-Node: tlmgr conf [texmf|tlmgr|updmap [--conffile _file_] [--delete] [_key_ [_value_]]]112314
-Node: tlmgr conf auxtrees [--conffile _file_] [show|add|delete] [_value_]112752
-Node: tlmgr dump-tlpdb [--local|--remote]115320
-Ref: tlmgr *--local*115817
-Ref: tlmgr *--remote*115856
-Node: tlmgr generate [_option_]... _what_116278
-Ref: tlmgr *generate language*116519
-Ref: tlmgr *generate language.dat*116544
-Ref: tlmgr *generate language.def*116569
-Ref: tlmgr *generate language.dat.lua*116598
-Ref: tlmgr *--dest* _output_file_118924
-Ref: tlmgr *--localcfg* _local_conf_file_119500
-Ref: tlmgr *--rebuild-sys*119623
-Node: tlmgr gui120438
-Node: tlmgr info [_option_...] [collections|schemes|_pkg_...]120684
-Ref: tlmgr *--list*122377
-Ref: tlmgr *--only-installed*122656
-Node: tlmgr init-usertree122809
-Node: tlmgr install [_option_]... _pkg_...123235
-Ref: tlmgr *--dry-run* 1123776
-Ref: tlmgr *--file*123893
-Ref: tlmgr *--force*124115
-Ref: tlmgr *--no-depends*124335
-Ref: tlmgr *--no-depends-at-all*124494
-Ref: tlmgr *--reinstall*124894
-Ref: tlmgr *--with-doc*125272
-Ref: tlmgr *--with-src*125285
-Node: tlmgr key list|add _file_|remove _keyid_125807
-Node: tlmgr option126602
-Ref: tlmgr *option [show]*126779
-Ref: tlmgr *option showall*126797
-Ref: tlmgr *option _key_ [_value_]*126823
-Node: tlmgr paper130863
-Ref: tlmgr *paper [a4|letter]*131048
-Ref: tlmgr *[xdvi|pdftex|dvips|dvipdfmx|context|psutils] paper [_papersize_|--list]*131122
-Node: tlmgr path [--w32mode=user|admin] [add|remove]132149
-Node: tlmgr pinning133632
-Ref: tlmgr pinning show133939
-Ref: tlmgr pinning add _repo_ _pkgglob_...134012
-Ref: tlmgr pinning remove _repo_ _pkgglob_...134131
-Ref: tlmgr pinning remove _repo_ --all134284
-Node: tlmgr platform list|add|remove _platform_...134338
-Node: tlmgr platform set _platform_134586
-Node: tlmgr platform set auto134814
-Ref: tlmgr *--dry-run* 2135931
-Node: tlmgr postaction [--w32mode=user|admin] [--fileassocmode=1|2] [--all] [install|remove] [shortcut|fileassoc|script] [_pkg_]...136040
-Node: tlmgr print-platform137342
-Node: tlmgr remove [_option_]... _pkg_...137792
-Ref: tlmgr *--backup*138274
-Ref: tlmgr *--backupdir* _directory_ 1138300
-Ref: tlmgr *--no-depends* 1139393
-Ref: tlmgr *--no-depends-at-all* 1139455
-Ref: tlmgr *--force* 1139511
-Ref: tlmgr *--dry-run* 3139983
-Node: tlmgr repository140090
-Ref: tlmgr *repository list*140322
-Ref: tlmgr *repository list _path|tag_*140352
-Ref: tlmgr *repository add _path_ [_tag_]*140385
-Ref: tlmgr *repository remove _path|tag_*140417
-Ref: tlmgr *repository set _path_[#_tag_] [_path_[#_tag_] ...]*140471
-Node: tlmgr restore [--backupdir _dir_] [--all | _pkg_ [_rev_]]141555
-Ref: tlmgr *--all* 1142494
-Ref: tlmgr *--backupdir* _directory_ 2142688
-Ref: tlmgr *--dry-run* 4142844
-Ref: tlmgr *--force* 2142961
-Node: tlmgr search [_option_...] _what_142989
-Node: tlmgr search [_option_...] --file _what_143329
-Node: tlmgr search [_option_...] --all _what_143575
-Ref: tlmgr *--file* 1144016
-Ref: tlmgr *--all* 2144068
-Ref: tlmgr *--global*144147
-Ref: tlmgr *--word*144259
-Node: tlmgr shell144549
-Ref: tlmgr protocol145310
-Ref: tlmgr help 1145374
-Ref: tlmgr version 1145427
-Ref: tlmgr quit, end, bye, byebye, EOF145495
-Ref: tlmgr restart145516
-Ref: tlmgr load [local|remote]145639
-Ref: tlmgr save145709
-Ref: tlmgr get [_var_] =item set [_var_ [_val_]]145832
-Node: tlmgr uninstall146324
-Ref: tlmgr *--force* 3146556
-Node: tlmgr update [_option_]... [_pkg_]...146612
-Ref: tlmgr *--all* 3146983
-Ref: tlmgr *--self*148724
-Ref: tlmgr *--dry-run* 5149488
-Ref: tlmgr *--list* [_pkg_]149665
-Ref: tlmgr *--exclude* _pkg_150354
-Ref: tlmgr *--no-auto-remove* [_pkg_]...151047
-Ref: tlmgr *--no-auto-install* [_pkg_]...151498
-Ref: tlmgr *--reinstall-forcibly-removed*152154
-Ref: tlmgr *--backup* 1152689
-Ref: tlmgr *--backupdir* _directory_ 3152715
-Ref: tlmgr *--no-depends* 2153912
-Ref: tlmgr *--no-depends-at-all* 2154115
-Ref: tlmgr *--force* 4154171
-Node: tlmgr CONFIGURATION FILE FOR TLMGR154986
-Ref: tlmgr auto-remove, value 0 or 1 (default 1), same as command-line option.155999
-Ref: tlmgr gui-expertmode, value 0 or 1 (default 1). This switches between the full GUI and a simplified GUI with only the most common settings.156136
-Ref: tlmgr gui-lang _llcode_, with a language code value as with the command-line option.156218
-Ref: tlmgr no-checksums, value 0 or 1 (default 0, see below).156272
-Ref: tlmgr persistent-downloads, value 0 or 1 (default 1), same as command-line option.156352
-Ref: tlmgr require-verification, value 0 or 1 (default 0), same as command-line option.156432
-Ref: tlmgr verify-downloads, value 0 or 1 (default 1), same as command-line option.156508
-Ref: tlmgr allowed-actions _action1_ [,_action_,...] The value is a comma-separated list of tlmgr actions which are allowed to be executed when tlmgr is invoked in system mode (that is, without --usermode).156777
-Node: tlmgr CRYPTOGRAPHIC VERIFICATION158101
-Node: tlmgr Configuration of GnuPG invocation159774
-Node: tlmgr USER MODE160412
-Node: tlmgr User mode install163235
-Node: tlmgr User mode backup, restore, remove, update164379
-Node: tlmgr User mode generate, option, paper164821
-Node: tlmgr MULTIPLE REPOSITORIES165197
-Node: tlmgr Pinning166926
-Node: tlmgr GUI FOR TLMGR168901
-Node: tlmgr Main display170241
-Node: tlmgr Display configuration area170493
-Ref: tlmgr Status170854
-Ref: tlmgr Category171018
-Ref: tlmgr Match171204
-Ref: tlmgr Selection171385
-Ref: tlmgr Display configuration buttons171589
-Node: tlmgr Package list area171772
-Ref: tlmgr a checkbox172356
-Ref: tlmgr package name172492
-Ref: tlmgr local revision (and version)172591
-Ref: tlmgr remote revision (and version)172966
-Ref: tlmgr short description173263
-Node: tlmgr Main display action buttons173308
-Ref: tlmgr Update all installed173574
-Ref: tlmgr Update173946
-Ref: tlmgr Install173996
-Ref: tlmgr Remove174182
-Ref: tlmgr Backup174360
-Node: tlmgr Menu bar174517
-Ref: tlmgr tlmgr menu174740
-Ref: tlmgr Options menu175048
-Ref: tlmgr Actions menu176131
-Ref: tlmgr Help menu176559
-Node: tlmgr GUI options176692
-Ref: tlmgr -background _color_176938
-Ref: tlmgr -font " _fontname_ _fontsize_ "177003
-Ref: tlmgr -foreground _color_177161
-Ref: tlmgr -geometry _geomspec_177213
-Ref: tlmgr -xrm _xresource_177405
-Node: tlmgr MACHINE-READABLE OUTPUT177673
-Node: tlmgr Machine-readable update and install output178483
-Ref: tlmgr location-url _location_179759
-Ref: tlmgr total-bytes _count_179975
-Ref: tlmgr _pkgname_180385
-Ref: tlmgr _status_180595
-Ref: tlmgr d180673
-Ref: tlmgr f180733
-Ref: tlmgr u180912
-Ref: tlmgr r180958
-Ref: tlmgr a181081
-Ref: tlmgr i181259
-Ref: tlmgr I181378
-Ref: tlmgr _localrev_181480
-Ref: tlmgr _serverrev_181587
-Ref: tlmgr _size_181699
-Ref: tlmgr _runtime_181868
-Ref: tlmgr _esttot_181938
-Node: tlmgr Machine-readable option output181971
-Node: tlmgr AUTHORS AND COPYRIGHT182483
-Node: Index182882
+Node: Top-level directories25098
+Node: Autoconf macros27512
+Node: General setup macros28213
+Node: Macros for programs29080
+Node: Macros for compilers29892
+Node: Macros for libraries31326
+Node: Macros for library and header flags31752
+Node: Macros for Windows33632
+Node: Library modules35209
+Node: png library35698
+Node: zlib library37972
+Node: freetype library38487
+Node: kpathsea library39015
+Node: Program modules40414
+Node: t1utils package40842
+Node: xindy package41393
+Node: xdvik package42543
+Node: asymptote43616
+Node: Extending TeX Live44067
+Node: Adding a new program module44844
+Node: Adding a new generic library module46363
+Node: Adding a new TeX-specific library module48576
+Node: Configure options49263
+Node: Global configure options50645
+Node: --disable-native-texlive-build51187
+Node: --prefix --bindir ...52177
+Node: --disable-largefile52717
+Node: --disable-missing53402
+Node: --enable-compiler-warnings=LEVEL53803
+Node: --enable-cxx-runtime-hack54542
+Node: --enable-maintainer-mode54969
+Node: --enable-multiplatform55498
+Node: --enable-shared56036
+Node: --enable-silent-rules56407
+Node: --without-ln-s56863
+Node: --without-x57214
+Node: Program-specific configure options57402
+Node: --enable-PROG --disable-PROG58045
+Node: --disable-all-pkgs58322
+Node: Configure options for texk/web2c59308
+Node: Configure options for texk/bibtex-x61826
+Node: Configure options for texk/dvipdfm-x62369
+Node: Configure options for texk/dvisvgm63142
+Node: Configure options for texk/texlive64028
+Node: Configure options for texk/xdvik64449
+Node: Configure options for utils/xindy65053
+Node: Library-specific configure options65954
+Node: Configure options for kpathsea66965
+Node: Configure options for system poppler67674
+Node: Variables for configure68465
+Node: Cross compilation69893
+Node: Cross configuring71192
+Node: Cross problems72865
+Node: Coding conventions74512
+Node: Declarations and definitions75239
+Node: Const77421
+Node: install-tl79284
+Node: install-tl NAME79625
+Node: install-tl SYNOPSIS79783
+Node: install-tl DESCRIPTION79991
+Node: install-tl REFERENCES80992
+Node: install-tl OPTIONS81508
+Ref: install-tl *-gui* [[=]_module_]81862
+Ref: install-tl text82071
+Ref: install-tl wizard82194
+Ref: install-tl perltk82348
+Ref: install-tl *-no-gui*82782
+Ref: install-tl *-lang* _llcode_82863
+Ref: install-tl *-repository* _url|path_83550
+Ref: install-tl *-select-repository*85361
+Ref: install-tl *-all-options*85797
+Ref: install-tl *-custom-bin* _path_86104
+Ref: install-tl *-debug-translation*86759
+Ref: install-tl *-force-platform* _platform_86978
+Ref: install-tl *-help*, *--help*, *-?*87222
+Ref: install-tl *-in-place*87615
+Ref: install-tl *-logfile* _file_88142
+Ref: install-tl *-no-cls*88493
+Ref: install-tl *-non-admin*88624
+Ref: install-tl *--persistent-downloads*88729
+Ref: install-tl *--no-persistent-downloads*88757
+Ref: install-tl *-portable*89365
+Ref: install-tl *-print-platform*89504
+Ref: install-tl *-profile* _profile_89697
+Ref: install-tl *-q*91191
+Ref: install-tl *-scheme* _scheme_91253
+Ref: install-tl *-v*91727
+Ref: install-tl *-version*, *--version*91888
+Node: install-tl ENVIRONMENT VARIABLES92019
+Ref: install-tl TEXLIVE_INSTALL_ENV_NOCHECK92408
+Ref: install-tl TEXLIVE_INSTALL_NO_CONTEXT_CACHE92610
+Ref: install-tl TEXLIVE_INSTALL_PREFIX92716
+Ref: install-tl TEXLIVE_INSTALL_TEXMFCONFIG92747
+Ref: install-tl TEXLIVE_INSTALL_TEXMFHOME92776
+Ref: install-tl TEXLIVE_INSTALL_TEXMFLOCAL92806
+Ref: install-tl TEXLIVE_INSTALL_TEXMFSYSCONFIG92840
+Ref: install-tl TEXLIVE_INSTALL_TEXMFSYSVAR92871
+Ref: install-tl TEXLIVE_INSTALL_TEXMFVAR92899
+Ref: install-tl NOPERLDOC92954
+Node: install-tl AUTHORS AND COPYRIGHT93018
+Node: tlmgr93376
+Node: tlmgr NAME93813
+Node: tlmgr SYNOPSIS93938
+Node: tlmgr DESCRIPTION94128
+Node: tlmgr EXAMPLES95224
+Ref: tlmgr tlmgr option repository http://mirror.ctan.org/systems/texlive/tlnet95515
+Ref: tlmgr tlmgr update --list95696
+Ref: tlmgr tlmgr update --all95789
+Ref: tlmgr tlmgr info _pkg_95945
+Node: tlmgr OPTIONS96151
+Ref: tlmgr *--repository* _url|path_96671
+Ref: tlmgr *--gui* [_action_]97396
+Ref: tlmgr *--gui-lang* _llcode_97803
+Ref: tlmgr *--debug-translation*98486
+Ref: tlmgr *--machine-readable*98689
+Ref: tlmgr *--no-execute-actions*98957
+Ref: tlmgr *--package-logfile* _file_99150
+Ref: tlmgr *--pause*99405
+Ref: tlmgr *--persistent-downloads*99560
+Ref: tlmgr *--no-persistent-downloads*99588
+Ref: tlmgr *--pin-file*100082
+Ref: tlmgr *--usermode*100300
+Ref: tlmgr *--usertree* _dir_100420
+Node: tlmgr ACTIONS100970
+Node: tlmgr help102202
+Node: tlmgr version102678
+Node: tlmgr backup [--clean[=_N_]] [--backupdir _dir_] [--all | _pkg_]...102996
+Ref: tlmgr *--backupdir* _directory_104090
+Ref: tlmgr *--all*104287
+Ref: tlmgr *--clean*[=_N_]104509
+Ref: tlmgr *--dry-run*104806
+Node: tlmgr candidates _pkg_104926
+Ref: tlmgr *candidates _pkg_* 1105213
+Node: tlmgr check [_option_]... [files|depends|executes|runfiles|all]105357
+Ref: tlmgr *files*105800
+Ref: tlmgr *depends*105935
+Ref: tlmgr *executes*106277
+Ref: tlmgr *runfiles*106395
+Ref: tlmgr *--use-svn*106507
+Node: tlmgr conf [texmf|tlmgr|updmap [--conffile _file_] [--delete] [_key_ [_value_]]]106624
+Node: tlmgr dump-tlpdb [--local|--remote]108696
+Ref: tlmgr *--local*109206
+Ref: tlmgr *--remote*109245
+Node: tlmgr generate [_option_]... _what_109667
+Ref: tlmgr *generate language*109908
+Ref: tlmgr *generate language.dat*109933
+Ref: tlmgr *generate language.def*109958
+Ref: tlmgr *generate language.dat.lua*109987
+Ref: tlmgr *generate fmtutil*110007
+Ref: tlmgr *--dest* _output_file_112244
+Ref: tlmgr *--localcfg* _local_conf_file_112820
+Ref: tlmgr *--rebuild-sys*112943
+Node: tlmgr gui113804
+Node: tlmgr info [_option_...] [collections|schemes|_pkg_...]114048
+Ref: tlmgr *--list*115253
+Ref: tlmgr *--only-installed*115532
+Ref: tlmgr *--taxonomy*115747
+Ref: tlmgr *--keyword*115759
+Ref: tlmgr *--functionality*115777
+Ref: tlmgr *--characterization*115798
+Node: tlmgr init-usertree116011
+Node: tlmgr install [_option_]... _pkg_...116437
+Ref: tlmgr *--file*116801
+Ref: tlmgr *--reinstall*117027
+Ref: tlmgr *--no-depends*117407
+Ref: tlmgr *--no-depends-at-all*117566
+Ref: tlmgr *--dry-run* 1117964
+Ref: tlmgr *--force*118082
+Node: tlmgr option118288
+Ref: tlmgr *option [show]*118461
+Ref: tlmgr *option showall*118479
+Ref: tlmgr *option _key_ [_value_]*118505
+Node: tlmgr paper122353
+Ref: tlmgr *paper [a4|letter]*122538
+Ref: tlmgr *[xdvi|pdftex|dvips|dvipdfmx|context|psutils] paper [_papersize_|--list]*122612
+Node: tlmgr path [--w32mode=user|admin] [add|remove]123639
+Node: tlmgr pinning125122
+Ref: tlmgr pinning show125429
+Ref: tlmgr pinning add _repo_ _pkgglob_...125502
+Ref: tlmgr pinning remove _repo_ _pkgglob_...125621
+Ref: tlmgr pinning remove _repo_ --all125774
+Node: tlmgr platform list|add|remove _platform_...125828
+Node: tlmgr platform set _platform_126076
+Node: tlmgr platform set auto126304
+Ref: tlmgr *--dry-run* 2127421
+Node: tlmgr postaction [--w32mode=user|admin] [--fileassocmode=1|2] [--all] [install|remove] [shortcut|fileassoc|script] [_pkg_]...127530
+Node: tlmgr print-platform128832
+Node: tlmgr restore [--backupdir _dir_] [--all | _pkg_ [_rev_]]129304
+Ref: tlmgr *--all* 1130200
+Ref: tlmgr *--backupdir* _directory_ 1130394
+Ref: tlmgr *--dry-run* 3130550
+Ref: tlmgr *--force* 1130667
+Node: tlmgr remove [_option_]... _pkg_...130695
+Ref: tlmgr *--no-depends* 1131218
+Ref: tlmgr *--no-depends-at-all* 1131280
+Ref: tlmgr *--force* 2131336
+Ref: tlmgr *--dry-run* 4131808
+Node: tlmgr repository131915
+Ref: tlmgr *repository list*132123
+Ref: tlmgr *repository list _path|tag_*132153
+Ref: tlmgr *repository add _path_ [_tag_]*132186
+Ref: tlmgr *repository remove _path|tag_*132218
+Ref: tlmgr *repository set _path_[#_tag_] [_path_[#_tag_] ...]*132272
+Node: tlmgr search [_option_...] _what_133356
+Node: tlmgr search [_option_...] --file _what_133867
+Node: tlmgr search [_option_...] --taxonomy _what_134118
+Node: tlmgr search [_option_...] --keyword _what_134429
+Node: tlmgr search [_option_...] --functionality _what_134747
+Node: tlmgr search [_option_...] --characterization _what_135085
+Node: tlmgr search [_option_...] --all _what_135425
+Ref: tlmgr *--global*135873
+Ref: tlmgr *--word*135985
+Ref: tlmgr *--list* 1136224
+Ref: tlmgr *--file* 1136570
+Ref: tlmgr *--taxonomy* 1136627
+Ref: tlmgr *--keyword* 1136639
+Ref: tlmgr *--functionality* 1136657
+Ref: tlmgr *--characterization* 1136678
+Ref: tlmgr *--all* 2136833
+Node: tlmgr uninstall136916
+Ref: tlmgr *--force* 3137170
+Node: tlmgr update [_option_]... [_pkg_]...137226
+Ref: tlmgr *--all* 3137597
+Ref: tlmgr *--self*139338
+Ref: tlmgr *--dry-run* 5140102
+Ref: tlmgr *--list* [_pkg_]140279
+Ref: tlmgr *--exclude* _pkg_140968
+Ref: tlmgr *--no-auto-remove* [_pkg_]...141661
+Ref: tlmgr *--no-auto-install* [_pkg_]...142112
+Ref: tlmgr *--reinstall-forcibly-removed*142768
+Ref: tlmgr *--backup* and *--backupdir* _directory_143332
+Ref: tlmgr *--no-depends* 2144513
+Ref: tlmgr *--no-depends-at-all* 2144716
+Ref: tlmgr *--force* 4144772
+Node: tlmgr USER MODE145198
+Node: tlmgr user mode install148009
+Node: tlmgr user mode backup; restore; remove; update148956
+Node: tlmgr user mode generate; option; paper149398
+Node: tlmgr CONFIGURATION FILE FOR TLMGR149774
+Node: tlmgr TAXONOMIES150865
+Ref: tlmgr --keyword 2151491
+Ref: tlmgr --functionality 2151576
+Ref: tlmgr --characterization 2151732
+Ref: tlmgr --taxonomy 2151873
+Node: tlmgr MULTIPLE REPOSITORIES152414
+Node: tlmgr Pinning154135
+Node: tlmgr GUI FOR TLMGR156110
+Node: tlmgr Main display157332
+Node: tlmgr Display configuration area157584
+Ref: tlmgr Status157945
+Ref: tlmgr Category158109
+Ref: tlmgr Match158295
+Ref: tlmgr Selection158555
+Ref: tlmgr Display configuration buttons158759
+Node: tlmgr Package list area158942
+Ref: tlmgr a checkbox159526
+Ref: tlmgr package name159662
+Ref: tlmgr local revision (and version)159761
+Ref: tlmgr remote revision (and version)160136
+Ref: tlmgr short description160433
+Node: tlmgr Main display action buttons160478
+Ref: tlmgr Update all installed160744
+Ref: tlmgr Update161116
+Ref: tlmgr Install161166
+Ref: tlmgr Remove161352
+Ref: tlmgr Backup161530
+Node: tlmgr Menu bar161687
+Ref: tlmgr tlmgr menu161884
+Ref: tlmgr Options menu162192
+Ref: tlmgr Actions menu163275
+Ref: tlmgr Help menu163703
+Node: tlmgr MACHINE-READABLE OUTPUT163836
+Node: tlmgr Machine-readable update and install output164646
+Ref: tlmgr location-url _location_165922
+Ref: tlmgr total-bytes _count_166138
+Ref: tlmgr _pkgname_166548
+Ref: tlmgr _status_166758
+Ref: tlmgr d166836
+Ref: tlmgr f166896
+Ref: tlmgr u167075
+Ref: tlmgr r167121
+Ref: tlmgr a167244
+Ref: tlmgr i167422
+Ref: tlmgr I167541
+Ref: tlmgr _localrev_167643
+Ref: tlmgr _serverrev_167750
+Ref: tlmgr _size_167862
+Ref: tlmgr _runtime_168031
+Ref: tlmgr _esttot_168101
+Node: tlmgr Machine-readable option output168134
+Node: tlmgr AUTHORS AND COPYRIGHT168646
+Node: Index168993
 
 End Tag Table

Modified: branches/stable/source/src/libs/Makefile.in
===================================================================
--- branches/stable/source/src/libs/Makefile.in	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/Makefile.in	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.15.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2017 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -647,7 +647,7 @@
 	  ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
 	|| chmod -R a+r "$(distdir)"
 dist-gzip: distdir
-	tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+	tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz
 	$(am__post_remove_distdir)
 
 dist-bzip2: distdir
@@ -673,7 +673,7 @@
 	@echo WARNING: "Support for shar distribution archives is" \
 	               "deprecated." >&2
 	@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
-	shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
+	shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz
 	$(am__post_remove_distdir)
 
 dist-zip: distdir
@@ -691,7 +691,7 @@
 distcheck: dist
 	case '$(DIST_ARCHIVES)' in \
 	*.tar.gz*) \
-	  GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
+	  eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\
 	*.tar.bz2*) \
 	  bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
 	*.tar.lz*) \
@@ -701,7 +701,7 @@
 	*.tar.Z*) \
 	  uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
 	*.shar.gz*) \
-	  GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
+	  eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\
 	*.zip*) \
 	  unzip $(distdir).zip ;;\
 	esac

Modified: branches/stable/source/src/libs/README
===================================================================
--- branches/stable/source/src/libs/README	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/README	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,4 +1,4 @@
-$Id: README 44006 2017-04-24 04:08:31Z kakuto $
+$Id: README 45614 2017-10-26 23:41:55Z kakuto $
 Public domain.  Originally created by Karl Berry, 2005.
 
 Libraries we compile for TeX Live.
@@ -9,22 +9,22 @@
 
 See also comments in ../texk/README.
 
-cairo 1.14.8 - checked 09dec16
+cairo 1.14.10 - checked 20jun17
   http://cairographics.org/releases/
 
-freetype2 2.7.1 - checked 30dec16
+freetype2 2.8.1 - checked 16sep17
   http://savannah.nongnu.org/download/freetype/
 
-gd 2.2.4 - checked 18jan17
+gd 2.2.5 - checked 30aug17
   https://github.com/libgd/libgd/releases
 
 gmp 6.1.2 - checked 16dec16
   http://ftp.gnu.org/gnu/gmp/
 
-graphite2 1.3.9 - checked 13nov16
+graphite2 1.3.10 - checked 20jun17
   http://sourceforge.net/projects/silgraphite/files/graphite2/
 
-harfbuzz 1.4.6 - checked 24apr17
+harfbuzz 1.6.3 - checked 26oct17
   http://www.freedesktop.org/software/harfbuzz/release/
 
 icu 58.2 - checked 13mar17
@@ -33,7 +33,7 @@
 libpaper 1.1.24+nmu2 - checked 24oct13
   ftp://ftp.de.debian.org/debian/pool/main/libp/libpaper/
 
-libpng 1.6.29 - checked 16mar17
+libpng 1.6.34 - checked 29Sep17
   http://www.libpng.org/ - used by many
   http://www.libpng.org/pub/png/pngcode.html
 
@@ -43,7 +43,7 @@
 luajit 2.1.0-beta2 - checked 09mar16
   http://luajit.org/download/LuaJIT-2.1.0-beta1.tar.gz
 
-mpfr 3.1.5 - checked 28sep16
+mpfr 3.1.6 - checked 08sep17
   http://ftp.gnu.org/gnu/mpfr/
 
 pixman 0.34.0 - checked 04feb16
@@ -52,18 +52,18 @@
 poppler 0.52.0 - checked 17feb17
   http://poppler.freedesktop.org/ - used by luatex and xetex
 
-potrace 1.14 - checked 22feb17
+potrace 1.15 - checked 07aug17
   http://potrace.sourceforge.net
 
-teckit 2.5.6 - checked 30dec16
-  https://github.com/silnrsi/teckit/archive/2.5.6.tar.gz
+teckit 2.5.7 - checked 27jun17
+  https://github.com/silnrsi/teckit/archive/2.5.7.tar.gz
 
-xpdf 3.04 - checked 28may14
-  ftp://ftp.foolabs.com/pub/xpdf/
+xpdf 4.00 - checked 13aug17
+  http://www.xpdfreader.com/download.html
   with modifications for pdftex
 
 zlib 1.2.11 - checked 15jan17
   http://www.zlib.net/ - used by many
 
-zziplib 0.13.62 - checked 31mar16
+zziplib 0.13.66 - checked 20jun17
   http://zziplib.sourceforge.net/ - used by luatex

Modified: branches/stable/source/src/libs/aclocal.m4
===================================================================
--- branches/stable/source/src/libs/aclocal.m4	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/aclocal.m4	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,6 +1,6 @@
-# generated automatically by aclocal 1.15 -*- Autoconf -*-
+# generated automatically by aclocal 1.15.1 -*- Autoconf -*-
 
-# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+# Copyright (C) 1996-2017 Free Software Foundation, Inc.
 
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -20,7 +20,7 @@
 If you have problems, you may need to regenerate the build system entirely.
 To do so, use the procedure documented by the package, typically 'autoreconf'.])])
 
-# Copyright (C) 2002-2014 Free Software Foundation, Inc.
+# Copyright (C) 2002-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -35,7 +35,7 @@
 [am__api_version='1.15'
 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
 dnl require some minimum version.  Point them to the right macro.
-m4_if([$1], [1.15], [],
+m4_if([$1], [1.15.1], [],
       [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
 ])
 
@@ -51,7 +51,7 @@
 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.15])dnl
+[AM_AUTOMAKE_VERSION([1.15.1])dnl
 m4_ifndef([AC_AUTOCONF_VERSION],
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
@@ -58,7 +58,7 @@
 
 # AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
 
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -110,7 +110,7 @@
 
 # AM_CONDITIONAL                                            -*- Autoconf -*-
 
-# Copyright (C) 1997-2014 Free Software Foundation, Inc.
+# Copyright (C) 1997-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -141,7 +141,7 @@
 Usually this means the macro was only invoked conditionally.]])
 fi])])
 
-# Copyright (C) 1999-2014 Free Software Foundation, Inc.
+# Copyright (C) 1999-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -332,7 +332,7 @@
 
 # Generate code to set up dependency tracking.              -*- Autoconf -*-
 
-# Copyright (C) 1999-2014 Free Software Foundation, Inc.
+# Copyright (C) 1999-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -408,7 +408,7 @@
 
 # Do all the work for Automake.                             -*- Autoconf -*-
 
-# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+# Copyright (C) 1996-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -605,7 +605,7 @@
 done
 echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
 
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -626,7 +626,7 @@
 fi
 AC_SUBST([install_sh])])
 
-# Copyright (C) 2003-2014 Free Software Foundation, Inc.
+# Copyright (C) 2003-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -648,7 +648,7 @@
 # Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
 # From Jim Meyering
 
-# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+# Copyright (C) 1996-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -683,7 +683,7 @@
 
 # Check to see how 'make' treats includes.	            -*- Autoconf -*-
 
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -733,7 +733,7 @@
 
 # Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
 
-# Copyright (C) 1997-2014 Free Software Foundation, Inc.
+# Copyright (C) 1997-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -772,7 +772,7 @@
 
 # Helper functions for option handling.                     -*- Autoconf -*-
 
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -801,7 +801,7 @@
 AC_DEFUN([_AM_IF_OPTION],
 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
 
-# Copyright (C) 1999-2014 Free Software Foundation, Inc.
+# Copyright (C) 1999-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -848,7 +848,7 @@
 # For backward compatibility.
 AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
 
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -867,7 +867,7 @@
 
 # Check to make sure that the build environment is sane.    -*- Autoconf -*-
 
-# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+# Copyright (C) 1996-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -948,7 +948,7 @@
 rm -f conftest.file
 ])
 
-# Copyright (C) 2009-2014 Free Software Foundation, Inc.
+# Copyright (C) 2009-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1008,7 +1008,7 @@
 _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
 ])
 
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1036,7 +1036,7 @@
 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
 AC_SUBST([INSTALL_STRIP_PROGRAM])])
 
-# Copyright (C) 2006-2014 Free Software Foundation, Inc.
+# Copyright (C) 2006-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1055,7 +1055,7 @@
 
 # Check how to create a tarball.                            -*- Autoconf -*-
 
-# Copyright (C) 2004-2014 Free Software Foundation, Inc.
+# Copyright (C) 2004-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,

Modified: branches/stable/source/src/libs/configure
===================================================================
--- branches/stable/source/src/libs/configure	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/configure	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for TeX Live libs 2017.
+# Generated by GNU Autoconf 2.69 for TeX Live libs 2018/dev.
 #
 # Report bugs to <tex-k at tug.org>.
 #
@@ -579,8 +579,8 @@
 # Identity of this package.
 PACKAGE_NAME='TeX Live libs'
 PACKAGE_TARNAME='tex-live-libs'
-PACKAGE_VERSION='2017'
-PACKAGE_STRING='TeX Live libs 2017'
+PACKAGE_VERSION='2018/dev'
+PACKAGE_STRING='TeX Live libs 2018/dev'
 PACKAGE_BUGREPORT='tex-k at tug.org'
 PACKAGE_URL=''
 
@@ -1394,7 +1394,7 @@
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures TeX Live libs 2017 to adapt to many kinds of systems.
+\`configure' configures TeX Live libs 2018/dev to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1464,7 +1464,7 @@
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of TeX Live libs 2017:";;
+     short | recursive ) echo "Configuration of TeX Live libs 2018/dev:";;
    esac
   cat <<\_ACEOF
 
@@ -1753,7 +1753,7 @@
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-TeX Live libs configure 2017
+TeX Live libs configure 2018/dev
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1854,7 +1854,7 @@
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by TeX Live libs $as_me 2017, which was
+It was created by TeX Live libs $as_me 2018/dev, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -6061,7 +6061,7 @@
 
 # Define the identity of the package.
  PACKAGE='tex-live-libs'
- VERSION='2017'
+ VERSION='2018/dev'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -7049,7 +7049,7 @@
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by TeX Live libs $as_me 2017, which was
+This file was extended by TeX Live libs $as_me 2018/dev, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -7106,7 +7106,7 @@
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-TeX Live libs config.status 2017
+TeX Live libs config.status 2018/dev
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 

Modified: branches/stable/source/src/libs/libpng/ChangeLog
===================================================================
--- branches/stable/source/src/libs/libpng/ChangeLog	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/ChangeLog	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,3 +1,23 @@
+2017-09-29 Akira Kakuto  <kakuto at fuk.kindai.ac.jp>
+
+	Import libpng-1.6.34.
+	* version.ac: Adjust.
+
+2017-08-24 Akira Kakuto  <kakuto at fuk.kindai.ac.jp>
+
+	Import libpng-1.6.32.
+	* version.ac: Adjust.
+
+2017-07-27 Akira Kakuto  <kakuto at fuk.kindai.ac.jp>
+
+	Import libpng-1.6.31.
+	* version.ac: Adjust.
+
+2017-06-28 Akira Kakuto  <kakuto at fuk.kindai.ac.jp>
+
+	Import libpng-1.6.30.
+	* version.ac: Adjust.
+
 2017-03-27  Karl Berry  <karl at freefriends.org>
 
 	* Makefile.am (AM_TESTS_ENVIRONMENT): use instead of TESTS_ENVIRONMENT.

Modified: branches/stable/source/src/libs/libpng/Makefile.in
===================================================================
--- branches/stable/source/src/libs/libpng/Makefile.in	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/Makefile.in	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.15.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2017 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1084,7 +1084,7 @@
 	  ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
 	|| chmod -R a+r "$(distdir)"
 dist-gzip: distdir
-	tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+	tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz
 	$(am__post_remove_distdir)
 
 dist-bzip2: distdir
@@ -1110,7 +1110,7 @@
 	@echo WARNING: "Support for shar distribution archives is" \
 	               "deprecated." >&2
 	@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
-	shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
+	shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz
 	$(am__post_remove_distdir)
 
 dist-zip: distdir
@@ -1128,7 +1128,7 @@
 distcheck: dist
 	case '$(DIST_ARCHIVES)' in \
 	*.tar.gz*) \
-	  GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
+	  eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\
 	*.tar.bz2*) \
 	  bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
 	*.tar.lz*) \
@@ -1138,7 +1138,7 @@
 	*.tar.Z*) \
 	  uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
 	*.shar.gz*) \
-	  GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
+	  eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\
 	*.zip*) \
 	  unzip $(distdir).zip ;;\
 	esac

Modified: branches/stable/source/src/libs/libpng/README
===================================================================
--- branches/stable/source/src/libs/libpng/README	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/README	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,4 +1,4 @@
-	Building libpng-1.6.29 as part of the TL tree
+	Building libpng-1.6.34 as part of the TL tree
 	=============================================
 
 This directory libs/libpng/ uses a proxy Makefile.am to build the libpng library
@@ -5,7 +5,7 @@
 from the unmodified (*) source tree in libs/libpng/libpng-src/, bypassing
 the original build system.
 
-(*) The directory libpng-PATCHES contains patches (if any) applied to
+(*) The directory TLpatches contains patches (if any) applied to
 the original source tree.
 
 As far as applicable, the tests in libs/libpng-src/configure.ac have been
@@ -14,4 +14,4 @@
 =============================
 
 2009-07-23	Peter Breitenlohner <peb at mppmu.mpg.de>
-2017-03-16	Akira Kakuto <kakuto at fuk.kindai.ac.jp>
+2017-09-29	Akira Kakuto <kakuto at fuk.kindai.ac.jp>

Modified: branches/stable/source/src/libs/libpng/TLpatches/ChangeLog
===================================================================
--- branches/stable/source/src/libs/libpng/TLpatches/ChangeLog	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/TLpatches/ChangeLog	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,3 +1,19 @@
+2017-09-29  Akira Kakuto <kakuto at fuk.kindai.ac.jp>
+
+	Import libpng-1.6.34.
+
+2017-08-24  Akira Kakuto <kakuto at fuk.kindai.ac.jp>
+
+	Import libpng-1.6.32.
+
+2017-07-27  Akira Kakuto <kakuto at fuk.kindai.ac.jp>
+
+	Import libpng-1.6.31.
+
+2017-06-28  Akira Kakuto <kakuto at fuk.kindai.ac.jp>
+
+	Import libpng-1.6.30.
+
 2017-03-16  Akira Kakuto <kakuto at fuk.kindai.ac.jp>
 
 	Import libpng-1.6.29.

Modified: branches/stable/source/src/libs/libpng/TLpatches/TL-Changes
===================================================================
--- branches/stable/source/src/libs/libpng/TLpatches/TL-Changes	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/TLpatches/TL-Changes	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,5 +1,5 @@
-Changes applied to the libpng-1.6.29/ tree as obtained from:
-	http://www.libpng.org/ libpng-1.6.29.tar.xz
+Changes applied to the libpng-1.6.34/ tree as obtained from:
+	http://www.libpng.org/ libpng-1.6.34.tar.xz
 
 Copied:
 	scripts/pnglibconf.h.prebuilt -> pnglibconf.h

Modified: branches/stable/source/src/libs/libpng/aclocal.m4
===================================================================
--- branches/stable/source/src/libs/libpng/aclocal.m4	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/aclocal.m4	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,6 +1,6 @@
-# generated automatically by aclocal 1.15 -*- Autoconf -*-
+# generated automatically by aclocal 1.15.1 -*- Autoconf -*-
 
-# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+# Copyright (C) 1996-2017 Free Software Foundation, Inc.
 
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -20,7 +20,7 @@
 If you have problems, you may need to regenerate the build system entirely.
 To do so, use the procedure documented by the package, typically 'autoreconf'.])])
 
-# Copyright (C) 2002-2014 Free Software Foundation, Inc.
+# Copyright (C) 2002-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -35,7 +35,7 @@
 [am__api_version='1.15'
 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
 dnl require some minimum version.  Point them to the right macro.
-m4_if([$1], [1.15], [],
+m4_if([$1], [1.15.1], [],
       [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
 ])
 
@@ -51,7 +51,7 @@
 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.15])dnl
+[AM_AUTOMAKE_VERSION([1.15.1])dnl
 m4_ifndef([AC_AUTOCONF_VERSION],
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
@@ -58,7 +58,7 @@
 
 # AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
 
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -110,7 +110,7 @@
 
 # AM_CONDITIONAL                                            -*- Autoconf -*-
 
-# Copyright (C) 1997-2014 Free Software Foundation, Inc.
+# Copyright (C) 1997-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -141,7 +141,7 @@
 Usually this means the macro was only invoked conditionally.]])
 fi])])
 
-# Copyright (C) 1999-2014 Free Software Foundation, Inc.
+# Copyright (C) 1999-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -332,7 +332,7 @@
 
 # Generate code to set up dependency tracking.              -*- Autoconf -*-
 
-# Copyright (C) 1999-2014 Free Software Foundation, Inc.
+# Copyright (C) 1999-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -408,7 +408,7 @@
 
 # Do all the work for Automake.                             -*- Autoconf -*-
 
-# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+# Copyright (C) 1996-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -605,7 +605,7 @@
 done
 echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
 
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -626,7 +626,7 @@
 fi
 AC_SUBST([install_sh])])
 
-# Copyright (C) 2003-2014 Free Software Foundation, Inc.
+# Copyright (C) 2003-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -648,7 +648,7 @@
 # Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
 # From Jim Meyering
 
-# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+# Copyright (C) 1996-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -683,7 +683,7 @@
 
 # Check to see how 'make' treats includes.	            -*- Autoconf -*-
 
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -733,7 +733,7 @@
 
 # Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
 
-# Copyright (C) 1997-2014 Free Software Foundation, Inc.
+# Copyright (C) 1997-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -772,7 +772,7 @@
 
 # Helper functions for option handling.                     -*- Autoconf -*-
 
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -801,7 +801,7 @@
 AC_DEFUN([_AM_IF_OPTION],
 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
 
-# Copyright (C) 1999-2014 Free Software Foundation, Inc.
+# Copyright (C) 1999-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -848,7 +848,7 @@
 # For backward compatibility.
 AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
 
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -867,7 +867,7 @@
 
 # Check to make sure that the build environment is sane.    -*- Autoconf -*-
 
-# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+# Copyright (C) 1996-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -948,7 +948,7 @@
 rm -f conftest.file
 ])
 
-# Copyright (C) 2009-2014 Free Software Foundation, Inc.
+# Copyright (C) 2009-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1008,7 +1008,7 @@
 _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
 ])
 
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1036,7 +1036,7 @@
 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
 AC_SUBST([INSTALL_STRIP_PROGRAM])])
 
-# Copyright (C) 2006-2014 Free Software Foundation, Inc.
+# Copyright (C) 2006-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1055,7 +1055,7 @@
 
 # Check how to create a tarball.                            -*- Autoconf -*-
 
-# Copyright (C) 2004-2014 Free Software Foundation, Inc.
+# Copyright (C) 2004-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,

Modified: branches/stable/source/src/libs/libpng/configure
===================================================================
--- branches/stable/source/src/libs/libpng/configure	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/configure	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for libpng (TeX Live) 1.6.29.
+# Generated by GNU Autoconf 2.69 for libpng (TeX Live) 1.6.34.
 #
 # Report bugs to <tex-k at tug.org>.
 #
@@ -580,8 +580,8 @@
 # Identity of this package.
 PACKAGE_NAME='libpng (TeX Live)'
 PACKAGE_TARNAME='libpng--tex-live-'
-PACKAGE_VERSION='1.6.29'
-PACKAGE_STRING='libpng (TeX Live) 1.6.29'
+PACKAGE_VERSION='1.6.34'
+PACKAGE_STRING='libpng (TeX Live) 1.6.34'
 PACKAGE_BUGREPORT='tex-k at tug.org'
 PACKAGE_URL=''
 
@@ -1287,7 +1287,7 @@
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures libpng (TeX Live) 1.6.29 to adapt to many kinds of systems.
+\`configure' configures libpng (TeX Live) 1.6.34 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1354,7 +1354,7 @@
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of libpng (TeX Live) 1.6.29:";;
+     short | recursive ) echo "Configuration of libpng (TeX Live) 1.6.34:";;
    esac
   cat <<\_ACEOF
 
@@ -1459,7 +1459,7 @@
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-libpng (TeX Live) configure 1.6.29
+libpng (TeX Live) configure 1.6.34
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1882,7 +1882,7 @@
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by libpng (TeX Live) $as_me 1.6.29, which was
+It was created by libpng (TeX Live) $as_me 1.6.34, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -3805,7 +3805,7 @@
 
 # Define the identity of the package.
  PACKAGE='libpng--tex-live-'
- VERSION='1.6.29'
+ VERSION='1.6.34'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -6358,7 +6358,7 @@
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by libpng (TeX Live) $as_me 1.6.29, which was
+This file was extended by libpng (TeX Live) $as_me 1.6.34, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -6424,7 +6424,7 @@
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-libpng (TeX Live) config.status 1.6.29
+libpng (TeX Live) config.status 1.6.34
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 

Modified: branches/stable/source/src/libs/libpng/include/Makefile.in
===================================================================
--- branches/stable/source/src/libs/libpng/include/Makefile.in	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/include/Makefile.in	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.15.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2017 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,

Modified: branches/stable/source/src/libs/libpng/libpng-src/ANNOUNCE
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/ANNOUNCE	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/ANNOUNCE	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,4 +1,4 @@
-Libpng 1.6.29 - March 16, 2017
+Libpng 1.6.34 - September 29, 2017
 
 This is a public release of libpng, intended for use in production codes.
 
@@ -7,38 +7,25 @@
 Source files with LF line endings (for Unix/Linux) and with a
 "configure" script
 
-   libpng-1.6.29.tar.xz (LZMA-compressed, recommended)
-   libpng-1.6.29.tar.gz
+   libpng-1.6.34.tar.xz (LZMA-compressed, recommended)
+   libpng-1.6.34.tar.gz
 
 Source files with CRLF line endings (for Windows), without the
 "configure" script
 
-   lpng1629.7z  (LZMA-compressed, recommended)
-   lpng1629.zip
+   lpng1634.7z  (LZMA-compressed, recommended)
+   lpng1634.zip
 
 Other information:
 
-   libpng-1.6.29-README.txt
-   libpng-1.6.29-LICENSE.txt
-   libpng-1.6.29-*.asc (armored detached GPG signatures)
+   libpng-1.6.34-README.txt
+   libpng-1.6.34-LICENSE.txt
+   libpng-1.6.34-*.asc (armored detached GPG signatures)
 
-Changes since the last public release (1.6.28):
+Changes since the last public release (1.6.33):
+  Removed contrib/pngsuite/i*.png; some of these were incorrect and caused
+    test failures.
 
-  Readded "include(GNUInstallDirs)" to CMakeLists.txt (Gianfranco Costamagna).
-  Moved SSE2 optimization code into the main libpng source directory.
-    Configure libpng with "configure --enable-intel-sse" or compile
-    libpng with "-DPNG_INTEL_SSE" in CPPFLAGS to enable it.
-  Simplified conditional compilation in pngvalid.c, for AIX (Michael Felt).
-  Avoid conditional directives that break statements in pngrutil.c (Romero
-    Malaquias)
-  The contrib/examples/pngtopng.c recovery code was in the wrong "if"
-    branches; the comments were correct.
-  Added code for PowerPC VSX optimisation (Vadim Barkov).
-  Avoid potential overflow of shift operations in png_do_expand() (Aaron Boxer).
-  Change test ZLIB_VERNUM >= 0x1281 to ZLIB_VERNUM >= 0x1290 in pngrutil.c
-    because Solaris 11 distributes zlib-1.2.8.f that is older than 1.2.8.1.
-  Suppress clang warnings about implicit sign changes in png.c
-
 Send comments/corrections/commendations to png-mng-implement at lists.sf.net
 (subscription required; visit
 https://lists.sourceforge.net/lists/listinfo/png-mng-implement

Modified: branches/stable/source/src/libs/libpng/libpng-src/CHANGES
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/CHANGES	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/CHANGES	2017-11-01 18:15:56 UTC (rev 780)
@@ -833,7 +833,7 @@
   Removed the new PNG_CREATED_READ_STRUCT and PNG_CREATED_WRITE_STRUCT modes
     which are no longer used.
   Eliminated the three new members of png_text when PNG_LEGACY_SUPPORTED is
-    defined or when neither PNG_READ_iTXt_SUPPORTED nor PNG_WRITE_iTXT_SUPPORTED
+    defined or when neither PNG_READ_iTXt_SUPPORTED nor PNG_WRITE_iTXt_SUPPORTED
     is defined.
   Made PNG_NO_READ|WRITE_iTXt the default setting, to avoid memory
     overrun when old applications fill the info_ptr->text structure directly.
@@ -5761,7 +5761,9 @@
     if built with zlib-1.2.8.1.
 
 Version 1.6.27rc01 [December 27, 2016]
-  Control ADLER32 checking with new PNG_IGNORE_ADLER32 option.
+  Control ADLER32 checking with new PNG_IGNORE_ADLER32 option. Fixes
+    an endless loop when handling erroneous ADLER32 checksums; bug
+    introduced in libpng-1.6.26.
   Removed the use of a macro containing the pre-processor 'defined'
     operator.  It is unclear whether this is valid; a macro that
     "generates" 'defined' is not permitted, but the use of the word
@@ -5811,12 +5813,234 @@
 Version 1.6.29beta03 [March 1, 2017]
   Avoid potential overflow of shift operations in png_do_expand() (Aaron Boxer).
   Change test ZLIB_VERNUM >= 0x1281 to ZLIB_VERNUM >= 0x1290 in pngrutil.c
-    because Solaris 11 distributes zlib-1.2.8.f that is older than 1.2.8.1.
+    because Solaris 11 distributes zlib-1.2.8.f that is older than 1.2.8.1,
+    as suggested in zlib FAQ, item 24.
   Suppress clang warnings about implicit sign changes in png.c
 
 Version 1.6.29 [March 16, 2017]
   No changes.
 
+Version 1.6.30beta01 [April 1, 2017]
+  Added missing "$(CPPFLAGS)" to the compile line for c.pic.o in
+    makefile.linux and makefile.solaris-x86 (Cosmin).
+  Revised documentation of png_get_error_ptr() in the libpng manual.
+  Silence clang -Wcomma and const drop warnings (Viktor Szakats).
+  Update Sourceforge URLs in documentation (https instead of http).
+
+Version 1.6.30beta02 [April 22, 2017]
+  Document need to check for integer overflow when allocating a pixel
+    buffer for multiple rows in contrib/gregbook, contrib/pngminus,
+    example.c, and in the manual (suggested by Jaeseung Choi). This
+    is similar to the bug reported against pngquant in CVE-2016-5735.
+  Removed reference to the obsolete PNG_SAFE_LIMITS macro in the documentation.
+
+Version 1.6.30beta03 [May 22, 2017]
+  Check for integer overflow in contrib/visupng and contrib/tools/genpng.
+  Do not double evaluate CMAKE_SYSTEM_PROCESSOR in CMakeLists.txt.
+  Test CMAKE_HOST_WIN32 instead of WIN32 in CMakeLists.txt.
+  Fix some URL in documentation.
+
+Version 1.6.30beta04 [June 7, 2017]
+  Avoid writing an empty IDAT when the last IDAT exactly fills the
+    compression buffer (bug report by Brian Baird). This bug was
+    introduced in libpng-1.6.0.
+
+Version 1.6.30rc01 [June 14, 2017]
+  No changes.
+
+Version 1.6.30rc02 [June 25, 2017]
+  Update copyright year in pnglibconf.h, make ltmain.sh executable.
+  Add a reference to the libpng.download site in README.
+
+Version 1.6.30 [June 28, 2017]
+  No changes.
+
+Version 1.6.31beta01 [July 5, 2017]
+  Guard the definition of _POSIX_SOURCE in pngpriv.h (AIX already defines it;
+    bug report by Michael Felt).
+  Revised pngpriv.h to work around failure to compile arm/filter_neon.S
+    ("typedef" directive is unrecognized by the assembler). The problem
+    was introduced in libpng-1.6.30beta01.
+  Added "Requires: zlib" to libpng.pc.in (Pieter Neerincx).
+  Added special case for FreeBSD in arm/filter_neon.S (Maya Rashish).
+
+Version 1.6.31beta02 [July 8, 2017]
+  Added instructions for disabling hardware optimizations in INSTALL.
+  Added "--enable-hardware-optimizations" configuration flag to enable
+    or disable all hardware optimizations with one flag.
+
+Version 1.6.31beta03 [July 9, 2017]
+  Updated CMakeLists.txt to add INTEL_SSE and MIPS_MSA platforms.
+  Changed "int" to "png_size_t" in intel/filter_sse2.c to prevent
+    possible integer overflow (Bug report by John Bowler).
+  Quieted "declaration after statement" warnings in intel/filter_sse2.c.
+  Added scripts/makefile-linux-opt, which has hardware optimizations enabled.
+
+Version 1.6.31beta04 [July 11, 2017]
+  Removed one of the GCC-7.1.0 'strict-overflow' warnings that result when
+    integers appear on both sides of a compare.  Worked around the others by
+    forcing the strict-overflow setting in the relevant functions to a level
+    where they are not reported (John Bowler).
+  Changed "FALL THROUGH" comments to "FALLTHROUGH" because GCC doesn't like
+    the space.
+  Worked around some C-style casts from (void*) because g++ 5.4.0 objects
+    to them.
+  Increased the buffer size for 'sprint' to pass the gcc 7.1.0 'sprint
+    overflow' check that is on by default with -Wall -Wextra.
+
+Version 1.6.31beta05 [July 13, 2017]
+  Added eXIf chunk support.
+
+Version 1.6.31beta06 [July 17, 2017]
+  Added a minimal eXIf chunk (with Orientation and FocalLengthIn35mmFilm
+    tags) to pngtest.png.
+
+Version 1.6.31beta07 [July 18, 2017]
+  Revised the eXIf chunk in pngtest.png to fix "Bad IFD1 Directory" warning.
+
+Version 1.6.31rc01 [July 19, 2017]
+  No changes.
+
+Version 1.6.31rc02 [July 25, 2017]
+  Fixed typo in example.c (png_free_image should be png_image_free) (Bug
+    report by John Smith)
+
+Version 1.6.31 [July 27, 2017]
+  No changes.
+
+Version 1.6.32beta01 [July 31, 2017]
+  Avoid possible NULL dereference in png_handle_eXIf when benign_errors
+    are allowed. Avoid leaking the input buffer "eXIf_buf".
+  Eliminated png_ptr->num_exif member from pngstruct.h and added num_exif
+    to arguments for png_get_eXIf() and png_set_eXIf().
+  Added calls to png_handle_eXIf(() in pngread.c and png_write_eXIf() in
+    pngwrite.c, and made various other fixes to png_write_eXIf().
+  Changed name of png_get_eXIF and png_set_eXIf() to png_get_eXIf_1() and
+    png_set_eXIf_1(), respectively, to avoid breaking API compatibility
+    with libpng-1.6.31.
+
+Version 1.6.32beta02 [August 1, 2017]
+  Updated contrib/libtests/pngunknown.c with eXIf chunk.
+
+Version 1.6.32beta03 [August 2, 2017]
+  Initialized btoa[] in pngstest.c
+  Stop memory leak when returning from png_handle_eXIf() with an error
+    (Bug report from the OSS-fuzz project).
+
+Version 1.6.32beta04 [August 2, 2017]
+  Replaced local eXIf_buf with info_ptr-eXIf_buf in png_handle_eXIf().
+  Update libpng.3 and libpng-manual.txt about eXIf functions.
+
+Version 1.6.32beta05 [August 2, 2017]
+  Restored png_get_eXIf() and png_set_eXIf() to maintain API compatability.
+
+Version 1.6.32beta06 [August 2, 2017]
+  Removed png_get_eXIf_1() and png_set_eXIf_1().
+
+Version 1.6.32beta07 [August 3, 2017]
+  Check length of all chunks except IDAT against user limit to fix an
+    OSS-fuzz issue (Fixes CVE-2017-12652).
+
+Version 1.6.32beta08 [August 3, 2017]
+  Check length of IDAT against maximum possible IDAT size, accounting
+    for height, rowbytes, interlacing and zlib/deflate overhead.
+  Restored png_get_eXIf_1() and png_set_eXIf_1(), because strlen(eXIf_buf)
+    does not work (the eXIf chunk data can contain zeroes).
+
+Version 1.6.32beta09 [August 3, 2017]
+  Require cmake-2.8.8 in CMakeLists.txt. Revised symlink creation,
+    no longer using deprecated cmake LOCATION feature (Clifford Yapp).
+  Fixed five-byte error in the calculation of IDAT maximum possible size.
+  
+Version 1.6.32beta10 [August 5, 2017]
+  Moved chunk-length check into a png_check_chunk_length() private
+    function (Suggested by Max Stepin).
+  Moved bad pngs from tests to contrib/libtests/crashers
+  Moved testing of bad pngs into a separate tests/pngtest-badpngs script
+  Added the --xfail (expected FAIL) option to pngtest.c. It writes XFAIL
+    in the output but PASS for the libpng test.
+  Require cmake-3.0.2 in CMakeLists.txt (Clifford Yapp).
+  Fix "const" declaration info_ptr argument to png_get_eXIf_1() and the
+    num_exif argument to png_get_eXIf_1() (Github Issue 171).
+
+Version 1.6.32beta11 [August 7, 2017]
+  Added "eXIf" to "chunks_to_ignore[]" in png_set_keep_unknown_chunks().
+  Added huge_IDAT.png and empty_ancillary_chunks.png to testpngs/crashers.
+  Make pngtest --strict, --relax, --xfail options imply -m (multiple).
+  Removed unused chunk_name parameter from png_check_chunk_length().
+  Relocated setting free_me for eXIf data, to stop an OSS-fuzz leak.
+  Initialize profile_header[] in png_handle_iCCP() to fix OSS-fuzz issue.
+  Initialize png_ptr->row_buf[0] to 255 in png_read_row() to fix OSS-fuzz UMR.
+  Attempt to fix a UMR in png_set_text_2() to fix OSS-fuzz issue.
+  Increase minimum zlib stream from 9 to 14 in png_handle_iCCP(), to account
+    for the minimum 'deflate' stream, and relocate the test to a point
+    after the keyword has been read.
+  Check that the eXIf chunk has at least 2 bytes and begins with "II" or "MM".
+
+Version 1.6.32rc01 [August 18, 2017]
+  Added a set of "huge_xxxx_chunk.png" files to contrib/testpngs/crashers,
+    one for each known chunk type, with length = 2GB-1.
+  Check for 0 return from png_get_rowbytes() and added some (size_t) typecasts
+    in contrib/pngminus/*.c to stop some Coverity issues (162705, 162706,
+    and 162707).
+  Renamed chunks in contrib/testpngs/crashers to avoid having files whose
+    names differ only in case; this causes problems with some platforms
+    (github issue #172).
+
+Version 1.6.32rc02 [August 22, 2017]
+  Added contrib/oss-fuzz directory which contains files used by the oss-fuzz
+    project (https://github.com/google/oss-fuzz/tree/master/projects/libpng).
+
+Version 1.6.32 [August 24, 2017]
+  No changes.
+
+Version 1.6.33beta01 [August 28, 2017]
+  Added PNGMINUS_UNUSED macro to contrib/pngminus/p*.c and added missing
+    parenthesis in contrib/pngminus/pnm2png.c (bug report by Christian Hesse).
+  Fixed off-by-one error in png_do_check_palette_indexes() (Bug report
+    by Mick P., Source Forge Issue #269).
+
+Version 1.6.33beta02 [September 3, 2017]
+  Initialize png_handler.row_ptr in contrib/oss-fuzz/libpng_read_fuzzer.cc
+    to fix shortlived oss-fuzz issue 3234.
+  Compute a larger limit on IDAT because some applications write a deflate
+    buffer for each row (Bug report by Andrew Church).
+  Use current date (DATE) instead of release-date (RDATE) in last
+    changed date of contrib/oss-fuzz files.
+  Enabled ARM support in CMakeLists.txt (Bernd Kuhls).
+
+Version 1.6.33beta03 [September 14, 2017]
+  Fixed incorrect typecast of some arguments to png_malloc() and
+    png_calloc() that were png_uint_32 instead of png_alloc_size_t
+    (Bug report by "irwir" in Github libpng issue #175).
+  Use pnglibconf.h.prebuilt when building for ANDROID with cmake (Github
+    issue 162, by rcdailey).
+
+Version 1.6.33rc01 [September 20, 2017]
+  Initialize memory allocated by png_inflate to zero, using memset, to
+    stop an oss-fuzz "use of uninitialized value" detection in png_set_text_2()
+    due to truncated iTXt or zTXt chunk.
+  Initialize memory allocated by png_read_buffer to zero, using memset, to
+    stop an oss-fuzz "use of uninitialized value" detection in
+    png_icc_check_tag_table() due to truncated iCCP chunk.
+  Removed a redundant test (suggested by "irwir" in Github issue #180).
+
+Version 1.6.33rc02 [September 23, 2017]
+  Added an interlaced version of each file in contrib/pngsuite.
+  Relocate new memset() call in pngrutil.c.
+  Removed more redundant tests (suggested by "irwir" in Github issue #180).
+  Add support for loading images with associated alpha in the Simplified
+    API (Samuel Williams).
+
+Version 1.6.33 [September 28, 2017]
+  Revert contrib/oss-fuzz/libpng_read_fuzzer.cc to libpng-1.6.32 state.
+  Initialize png_handler.row_ptr in contrib/oss-fuzz/libpng_read_fuzzer.cc
+  Add end_info structure and png_read_end() to the libpng fuzzer.
+
+Version 1.6.34 [September 29, 2017]
+  Removed contrib/pngsuite/i*.png; some of these were incorrect and caused
+    test failures.
+
 Send comments/corrections/commendations to png-mng-implement at lists.sf.net
 (subscription required; visit
 https://lists.sourceforge.net/lists/listinfo/png-mng-implement

Modified: branches/stable/source/src/libs/libpng/libpng-src/CMakeLists.txt
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/CMakeLists.txt	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/CMakeLists.txt	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,6 +1,6 @@
 # CMakeLists.txt
 
-# Copyright (C) 2007,2009-2016 Glenn Randers-Pehrson
+# Copyright (C) 2007,2009-2017 Glenn Randers-Pehrson
 # Written by Christian Ehrlicher, 2007
 # Revised by Roger Lowman, 2009-2010
 # Revised by Clifford Yapp, 2011-2012
@@ -11,8 +11,8 @@
 # For conditions of distribution and use, see the disclaimer
 # and license in png.h
 
-cmake_minimum_required(VERSION 2.8.3)
-cmake_policy(VERSION 2.8.3)
+cmake_minimum_required(VERSION 3.0.2)
+cmake_policy(VERSION 3.0.2)
 
 # Set MacOSX @rpath usage globally.
 if (POLICY CMP0020)
@@ -31,12 +31,12 @@
 
 set(CMAKE_CONFIGURATION_TYPES "Release;Debug;MinSizeRel;RelWithDebInfo")
 
-project(libpng C)
+project(libpng ASM C)
 enable_testing()
 
 set(PNGLIB_MAJOR 1)
 set(PNGLIB_MINOR 6)
-set(PNGLIB_RELEASE 29)
+set(PNGLIB_RELEASE 34)
 set(PNGLIB_NAME libpng${PNGLIB_MAJOR}${PNGLIB_MINOR})
 set(PNGLIB_VERSION ${PNGLIB_MAJOR}.${PNGLIB_MINOR}.${PNGLIB_RELEASE})
 
@@ -76,12 +76,16 @@
 option(PNG_DEBUG     "Build with debug output" OFF)
 option(PNGARG        "Disable ANSI-C prototypes" OFF)
 
+option(PNG_HARDWARE_OPTIMIZATIONS "Enable Hardware Optimizations" ON)
+
+
 set(PNG_PREFIX "" CACHE STRING "Prefix to add to the API function names")
 set(DFA_XTRA "" CACHE FILEPATH "File containing extra configuration settings")
 
+if(PNG_HARDWARE_OPTIMIZATIONS)
 # set definitions and sources for arm
-if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^arm" OR
-  ${CMAKE_SYSTEM_PROCESSOR} MATCHES "^aarch64")
+if(CMAKE_SYSTEM_PROCESSOR MATCHES "^arm" OR
+  CMAKE_SYSTEM_PROCESSOR MATCHES "^aarch64")
   set(PNG_ARM_NEON_POSSIBLE_VALUES check on off)
   set(PNG_ARM_NEON "check" CACHE STRING "Enable ARM NEON optimizations:
      check: (default) use internal checking code;
@@ -110,13 +114,11 @@
 endif()
 
 # set definitions and sources for powerpc
-if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^powerpc*" OR
-	${CMAKE_SYSTEM_PROCESSOR} MATCHES "^ppc64*" )
-  set(PNG_POWERPC_VSX_POSSIBLE_VALUES check on off)
-  set(PNG_POWERPC_VSX "check" CACHE STRING "Enable POWERPC VSX optimizations:
-     check: (default) use internal checking code;
-     off: disable the optimizations;
-     on: turn on unconditionally.")
+if(CMAKE_SYSTEM_PROCESSOR MATCHES "^powerpc*" OR
+	CMAKE_SYSTEM_PROCESSOR MATCHES "^ppc64*" )
+  set(PNG_POWERPC_VSX_POSSIBLE_VALUES on off)
+  set(PNG_POWERPC_VSX "on" CACHE STRING "Enable POWERPC VSX optimizations:
+     off: disable the optimizations.")
   set_property(CACHE PNG_POWERPC_VSX PROPERTY STRINGS
      ${PNG_POWERPC_VSX_POSSIBLE_VALUES})
   list(FIND PNG_POWERPC_VSX_POSSIBLE_VALUES ${PNG_POWERPC_VSX} index)
@@ -127,13 +129,8 @@
     set(libpng_powerpc_sources
       powerpc/powerpc_init.c
       powerpc/filter_vsx_intrinsics.c)
-
     if(${PNG_POWERPC_VSX} STREQUAL "on")
       add_definitions(-DPNG_POWERPC_VSX_OPT=2)
-    elseif(${PNG_POWERPC_VSX} STREQUAL "check")
-      add_definitions(-DPNG_POWERPC_VSX_CHECK_SUPPORTED)
-      message(WARNING
-      "[PNG_POWERPC_VSX==check] Please check contrib/powerpc/README file for the list of supported OSes.")
     endif()
   else()
     add_definitions(-DPNG_POWERPC_VSX_OPT=0)
@@ -140,7 +137,55 @@
   endif()
 endif()
 
+# set definitions and sources for intel
+if(CMAKE_SYSTEM_PROCESSOR MATCHES "^i?86" OR
+	CMAKE_SYSTEM_PROCESSOR MATCHES "^x86_64*" )
+  set(PNG_INTEL_SSE_POSSIBLE_VALUES on off)
+  set(PNG_INTEL_SSE "on" CACHE STRING "Enable INTEL_SSE optimizations:
+     off: disable the optimizations")
+  set_property(CACHE PNG_INTEL_SSE PROPERTY STRINGS
+     ${PNG_INTEL_SSE_POSSIBLE_VALUES})
+  list(FIND PNG_INTEL_SSE_POSSIBLE_VALUES ${PNG_INTEL_SSE} index)
+  if(index EQUAL -1)
+    message(FATAL_ERROR
+      " PNG_INTEL_SSE must be one of [${PNG_INTEL_SSE_POSSIBLE_VALUES}]")
+  elseif(NOT ${PNG_INTEL_SSE} STREQUAL "no")
+    set(libpng_intel_sources
+      intel/intel_init.c
+      intel/filter_sse2_intrinsics.c)
+    if(${PNG_INTEL_SSE} STREQUAL "on")
+      add_definitions(-DPNG_INTEL_SSE_OPT=1)
+    endif()
+  else()
+    add_definitions(-DPNG_INTEL_SSE_OPT=0)
+  endif()
+endif()
 
+# set definitions and sources for MIPS
+if(CMAKE_SYSTEM_PROCESSOR MATCHES "mipsel*" OR
+	CMAKE_SYSTEM_PROCESSOR MATCHES "mips64el*" )
+  set(PNG_MIPS_MSA_POSSIBLE_VALUES on off)
+  set(PNG_MIPS_MSA "on" CACHE STRING "Enable MIPS_MSA optimizations:
+     off: disable the optimizations")
+  set_property(CACHE PNG_MIPS_MSA PROPERTY STRINGS
+     ${PNG_MIPS_MSA_POSSIBLE_VALUES})
+  list(FIND PNG_MIPS_MSA_POSSIBLE_VALUES ${PNG_MIPS_MSA} index)
+  if(index EQUAL -1)
+    message(FATAL_ERROR
+      " PNG_MIPS_MSA must be one of [${PNG_MIPS_MSA_POSSIBLE_VALUES}]")
+  elseif(NOT ${PNG_MIPS_MSA} STREQUAL "no")
+    set(libpng_mips_sources
+      mips/mips_init.c
+      mips/filter_msa_intrinsics.c)
+    if(${PNG_MIPS_MSA} STREQUAL "on")
+      add_definitions(-DPNG_MIPS_MSA_OPT=2)
+    endif()
+  else()
+    add_definitions(-DPNG_MIPS_MSA_OPT=0)
+  endif()
+endif()
+endif(PNG_HARDWARE_OPTIMIZATIONS)
+
 # SET LIBNAME
 set(PNG_LIB_NAME png${PNGLIB_MAJOR}${PNGLIB_MINOR})
 
@@ -217,7 +262,7 @@
 
 include_directories(${CMAKE_CURRENT_BINARY_DIR})
 
-if(NOT AWK)
+if(NOT AWK OR ANDROID)
   # No awk available to generate sources; use pre-built pnglibconf.h
   configure_file(${CMAKE_CURRENT_SOURCE_DIR}/scripts/pnglibconf.h.prebuilt
                  ${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h)
@@ -396,7 +441,7 @@
     "${CMAKE_CURRENT_BINARY_DIR}/scripts/symbols.chk"
     "${CMAKE_CURRENT_BINARY_DIR}/scripts/symbols.out"
     "${CMAKE_CURRENT_BINARY_DIR}/scripts/vers.out")
-endif(NOT AWK)
+endif(NOT AWK OR ANDROID)
 
 # OUR SOURCES
 set(libpng_public_hdrs
@@ -410,7 +455,7 @@
   pnginfo.h
   pngstruct.h
 )
-if(AWK)
+if(AWK AND NOT ANDROID)
   list(APPEND libpng_private_hdrs "${CMAKE_CURRENT_BINARY_DIR}/pngprefix.h")
 endif()
 set(libpng_sources
@@ -432,6 +477,8 @@
   pngwtran.c
   pngwutil.c
   ${libpng_arm_sources}
+  ${libpng_intel_sources}
+  ${libpng_mips_sources}
   ${libpng_powerpc_sources}
 )
 set(pngtest_sources
@@ -708,32 +755,59 @@
   list(APPEND PNG_BIN_TARGETS png-fix-itxt)
 endif()
 
-# Ensure the CMAKE_LIBRARY_OUTPUT_DIRECTORY is set
-IF(NOT CMAKE_LIBRARY_OUTPUT_DIRECTORY)
-  SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY "lib")
-ENDIF(NOT CMAKE_LIBRARY_OUTPUT_DIRECTORY)
-
 # Set a variable with CMake code which:
 # Creates a symlink from src to dest (if possible) or alternatively
 # copies if different.
-macro(CREATE_SYMLINK SRC_FILE DEST_FILE)
-  FILE(REMOVE ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${DEST_FILE})
-  if(WIN32 AND NOT CYGWIN AND NOT MSYS)
-    ADD_CUSTOM_COMMAND(
-        OUTPUT ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${DEST_FILE}   ${CMAKE_CURRENT_BINARY_DIR}/${DEST_FILE}
-        COMMAND ${CMAKE_COMMAND} -E copy_if_different  "${SRC_FILE}" ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${DEST_FILE}
-        COMMAND ${CMAKE_COMMAND} -E copy_if_different  "${SRC_FILE}" ${CMAKE_CURRENT_BINARY_DIR}/${DEST_FILE}
-        DEPENDS ${PNG_LIB_TARGETS}
-        )
-    ADD_CUSTOM_TARGET(${DEST_FILE}_COPY ALL DEPENDS ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${DEST_FILE})
-  else(WIN32 AND NOT CYGWIN AND NOT MSYS)
-    get_filename_component(LINK_TARGET "${SRC_FILE}" NAME)
-    execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
-    execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink "${LINK_TARGET}" ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${DEST_FILE} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
-    execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink "${LINK_TARGET}" ${DEST_FILE} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
-  endif(WIN32 AND NOT CYGWIN AND NOT MSYS)
-endmacro()
+include(CMakeParseArguments)
 
+function(CREATE_SYMLINK DEST_FILE)
+
+  cmake_parse_arguments(S "" "FILE;TARGET" "" ${ARGN})
+
+  if(NOT S_TARGET AND NOT S_FILE)
+    message(FATAL_ERROR "Specify either a TARGET or a FILE for CREATE_SYMLINK to link to.")
+  endif(NOT S_TARGET AND NOT S_FILE)
+
+  if(S_TARGET AND S_FILE)
+    message(FATAL_ERROR "CREATE_SYMLINK called with both source file ${S_FILE} and build target ${S_TARGET} arguments - can only handle 1 type per call.")
+  endif(S_TARGET AND S_FILE)
+
+  if(S_FILE)
+    # If we don't need to symlink something that's coming from a build target,
+    # we can go ahead and symlink/copy at configure time.
+
+    if(CMAKE_HOST_WIN32 AND NOT CYGWIN AND NOT MSYS)
+      execute_process(
+	COMMAND "${CMAKE_COMMAND}" -E copy_if_different ${S_FILE} ${DEST_FILE}
+	WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
+	)
+    else(CMAKE_HOST_WIN32 AND NOT CYGWIN AND NOT MSYS)
+      execute_process(
+	COMMAND ${CMAKE_COMMAND} -E create_symlink ${S_FILE} ${DEST_FILE}
+	WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
+	)
+    endif(CMAKE_HOST_WIN32 AND NOT CYGWIN AND NOT MSYS)
+  endif(S_FILE)
+
+  if(S_TARGET)
+    # We need to use generator expressions, which can be a bit tricky, so for
+    # simplicity make the symlink a POST_BUILD step and use the TARGET
+    # signature of add_custom_command.
+
+    if(CMAKE_HOST_WIN32 AND NOT CYGWIN AND NOT MSYS)
+      add_custom_command(TARGET ${S_TARGET} POST_BUILD
+	COMMAND "${CMAKE_COMMAND}" -E copy_if_different $<TARGET_LINKER_FILE_NAME:${S_TARGET}> $<TARGET_LINKER_FILE_DIR:${S_TARGET}>/${DEST_FILE}
+	)
+    else(CMAKE_HOST_WIN32 AND NOT CYGWIN AND NOT MSYS)
+      add_custom_command(TARGET ${S_TARGET} POST_BUILD
+	COMMAND "${CMAKE_COMMAND}" -E create_symlink $<TARGET_LINKER_FILE_NAME:${S_TARGET}> $<TARGET_LINKER_FILE_DIR:${S_TARGET}>/${DEST_FILE}
+	)
+    endif(CMAKE_HOST_WIN32 AND NOT CYGWIN AND NOT MSYS)
+
+  endif(S_TARGET)
+
+endfunction()
+
 # Create source generation scripts.
 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/scripts/genchk.cmake.in
                ${CMAKE_CURRENT_BINARY_DIR}/scripts/genchk.cmake @ONLY)
@@ -760,17 +834,17 @@
   set(LIBS        "-lz -lm")
   configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libpng.pc.in
     ${CMAKE_CURRENT_BINARY_DIR}/${PNGLIB_NAME}.pc @ONLY)
-  CREATE_SYMLINK(${PNGLIB_NAME}.pc libpng.pc)
+  CREATE_SYMLINK(libpng.pc FILE ${PNGLIB_NAME}.pc)
 
   configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libpng-config.in
     ${CMAKE_CURRENT_BINARY_DIR}/${PNGLIB_NAME}-config @ONLY)
-  CREATE_SYMLINK(${PNGLIB_NAME}-config libpng-config)
+  CREATE_SYMLINK(libpng-config FILE ${PNGLIB_NAME}-config)
 endif(NOT WIN32 OR CYGWIN OR MINGW)
 
 # SET UP LINKS
 if(PNG_SHARED)
   set_target_properties(png PROPERTIES
-#   VERSION 16.${PNGLIB_RELEASE}.1.6.29
+#   VERSION 16.${PNGLIB_RELEASE}.1.6.34
     VERSION 16.${PNGLIB_RELEASE}.0
     SOVERSION 16
     CLEAN_DIRECT_OUTPUT 1)
@@ -797,26 +871,20 @@
   if(PNG_SHARED)
     # Create a symlink for libpng.dll.a => libpng16.dll.a on Cygwin
     if(CYGWIN OR MINGW)
-       get_target_property(BUILD_TARGET_LOCATION png LOCATION_${CMAKE_BUILD_TYPE})
-       CREATE_SYMLINK(${BUILD_TARGET_LOCATION} libpng${CMAKE_IMPORT_LIBRARY_SUFFIX})
-       install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libpng${CMAKE_IMPORT_LIBRARY_SUFFIX}
-         DESTINATION ${CMAKE_INSTALL_LIBDIR})
+      CREATE_SYMLINK(libpng${CMAKE_IMPORT_LIBRARY_SUFFIX} TARGET png)
+      install(FILES $<TARGET_LINKER_FILE_DIR:png>/libpng${CMAKE_IMPORT_LIBRARY_SUFFIX} DESTINATION ${CMAKE_INSTALL_LIBDIR})
     endif(CYGWIN OR MINGW)
 
     if(NOT WIN32)
-      get_target_property(BUILD_TARGET_LOCATION png LOCATION_${CMAKE_BUILD_TYPE})
-      CREATE_SYMLINK(${BUILD_TARGET_LOCATION} libpng${CMAKE_SHARED_LIBRARY_SUFFIX})
-      install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libpng${CMAKE_SHARED_LIBRARY_SUFFIX}
-         DESTINATION ${CMAKE_INSTALL_LIBDIR})
+      CREATE_SYMLINK(libpng${CMAKE_SHARED_LIBRARY_SUFFIX} TARGET png)
+      install(FILES $<TARGET_LINKER_FILE_DIR:png>/libpng${CMAKE_SHARED_LIBRARY_SUFFIX} DESTINATION ${CMAKE_INSTALL_LIBDIR})
     endif(NOT WIN32)
   endif(PNG_SHARED)
 
   if(PNG_STATIC)
     if(NOT WIN32 OR CYGWIN OR MINGW)
-      get_target_property(BUILD_TARGET_LOCATION png_static LOCATION_${CMAKE_BUILD_TYPE})
-      CREATE_SYMLINK(${BUILD_TARGET_LOCATION} libpng${CMAKE_STATIC_LIBRARY_SUFFIX})
-      install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libpng${CMAKE_STATIC_LIBRARY_SUFFIX}
-         DESTINATION ${CMAKE_INSTALL_LIBDIR})
+      CREATE_SYMLINK( libpng${CMAKE_STATIC_LIBRARY_SUFFIX} TARGET png_static)
+      install(FILES $<TARGET_LINKER_FILE_DIR:png_static>/libpng${CMAKE_STATIC_LIBRARY_SUFFIX} DESTINATION ${CMAKE_INSTALL_LIBDIR})
     endif(NOT WIN32 OR CYGWIN OR MINGW)
  endif()
 endif()
@@ -846,7 +914,7 @@
   install(FILES libpng.3 libpngpf.3      DESTINATION ${PNG_MAN_DIR}/man3)
   install(FILES png.5                    DESTINATION ${PNG_MAN_DIR}/man5)
   # Install pkg-config files
-  if(NOT WIN32 OR CYGWIN OR MINGW)
+  if(NOT CMAKE_HOST_WIN32 OR CYGWIN OR MINGW)
     install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libpng.pc
             DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
     install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/libpng-config
@@ -855,7 +923,7 @@
             DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
     install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${PNGLIB_NAME}-config
             DESTINATION bin)
-  endif(NOT WIN32 OR CYGWIN OR MINGW)
+  endif(NOT CMAKE_HOST_WIN32 OR CYGWIN OR MINGW)
 endif()
 
 # On versions of CMake that support it, create an export file CMake

Modified: branches/stable/source/src/libs/libpng/libpng-src/INSTALL
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/INSTALL	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/INSTALL	2017-11-01 18:15:56 UTC (rev 780)
@@ -16,10 +16,11 @@
       XI. Prepending a prefix to exported symbols
      XII. Configuring for compiler xxx:
     XIII. Removing unwanted object code
-     XIV. Changes to the build and configuration of libpng in libpng-1.5.x
-      XV. Setjmp/longjmp issues
-     XVI. Common linking failures
-    XVII. Other sources of information about libpng
+     XIV. Enabling or disabling hardware optimizations
+      XV. Changes to the build and configuration of libpng in libpng-1.5.x
+     XVI. Setjmp/longjmp issues
+    XVII. Common linking failures
+   XVIII. Other sources of information about libpng
 
 I. Simple installation
 
@@ -78,8 +79,8 @@
 
 Before installing libpng, you must first install zlib, if it
 is not already on your system.  zlib can usually be found
-wherever you got libpng; otherwise go to http://zlib.net.  You can place
-zlib in the same directory as libpng or in another directory.
+wherever you got libpng; otherwise go to https://zlib.net/.  You can
+place zlib in the same directory as libpng or in another directory.
 
 If your system already has a preinstalled zlib you will still need
 to have access to the zlib.h and zconf.h include files that
@@ -281,8 +282,58 @@
 The size of the library itself should not be an issue, because only
 those sections that are actually used will be loaded into memory.
 
-XIV. Changes to the build and configuration of libpng in libpng-1.5.x
+XIV. Enabling or disabling hardware optimizations
 
+Certain hardware capabilites, such as the Intel SSE instructions,
+are normally detected at run time. Enable them with configure options
+such as one of
+
+   --enable-arm-neon=yes
+   --enable-mips-msa=yes
+   --enable-intel-sse=yes
+   --enable-powerpc-vsx=yes
+
+or enable them all at once with
+
+   --enable-hardware-optimizations=yes
+
+or, if you are not using "configure", you can use one
+or more of
+
+   CPPFLAGS += "-DPNG_ARM_NEON"
+   CPPFLAGS += "-DPNG_MIPS_MSA"
+   CPPFLAGS += "-DPNG_INTEL_SSE"
+   CPPFLAGS += "-DPNG_POWERPC_VSX"
+
+See for example scripts/makefile.linux-opt
+
+If you wish to avoid using them,
+you can disable them via the configure option
+
+   --disable-hardware-optimizations
+
+to disable them all, or
+
+   --enable-intel-sse=no
+
+to disable a particular one,
+or via compiler-command options such as
+
+   CPPFLAGS += "-DPNG_ARM_NEON_OPT=0, -DPNG_MIPS_MSA_OPT=0,
+   -DPNG_INTEL_SSE_OPT=0, -DPNG_POWERPC_VSX_OPT=0"
+
+If you are using cmake, hardware optimizations are "on"
+by default. To disable them, use
+
+    cmake . -DPNG_ARM_NEON=no -DPNG_INTEL_SSE=no \
+            -DPNG_MIPS_MSA=no -DPNG_POWERPC_VSX=no
+
+or disable them all at once with
+
+    cmake . -DPNG_HARDWARE_OPTIMIZATIONS=no
+
+XV. Changes to the build and configuration of libpng in libpng-1.5.x
+
 Details of internal changes to the library code can be found in the CHANGES
 file and in the GIT repository logs.  These will be of no concern to the vast
 majority of library users or builders; however, the few who configure libpng
@@ -372,7 +423,7 @@
 libpng, because than the settings would not accurately reflect the settings
 that were used to build libpng.
 
-XV. Setjmp/longjmp issues
+XVI. Setjmp/longjmp issues
 
 Libpng uses setjmp()/longjmp() for error handling.  Unfortunately setjmp()
 is known to be not thread-safe on some platforms and we don't know of
@@ -390,7 +441,7 @@
 with PNG_SETJMP_SUPPORTED defined, or with PNG_SIMPLIFIED_READ_SUPPORTED
 and PNG_SIMPLIFIED_WRITE_SUPPORTED undefined.
 
-XVI. Common linking failures
+XVII. Common linking failures
 
 If your application fails to find libpng or zlib entries while linking:
 
@@ -402,7 +453,7 @@
   If you are using the vstudio project, observe the WARNING in
   project/vstudio/README.txt.
 
-XVII. Other sources of information about libpng:
+XVIII. Other sources of information about libpng:
 
 Further information can be found in the README and libpng-manual.txt
 files, in the individual makefiles, in png.h, and the manual pages

Modified: branches/stable/source/src/libs/libpng/libpng-src/LICENSE
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/LICENSE	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/LICENSE	2017-11-01 18:15:56 UTC (rev 780)
@@ -10,7 +10,7 @@
 
 This code is released under the libpng license.
 
-libpng versions 1.0.7, July 1, 2000 through 1.6.29, March 16, 2017 are
+libpng versions 1.0.7, July 1, 2000 through 1.6.34, September 29, 2017 are
 Copyright (c) 2000-2002, 2004, 2006-2017 Glenn Randers-Pehrson, are
 derived from libpng-1.0.6, and are distributed according to the same
 disclaimer and license as libpng-1.0.6 with the following individuals
@@ -130,4 +130,4 @@
 
 Glenn Randers-Pehrson
 glennrp at users.sourceforge.net
-March 16, 2017
+September 29, 2017

Modified: branches/stable/source/src/libs/libpng/libpng-src/Makefile.am
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/Makefile.am	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/Makefile.am	2017-11-01 18:15:56 UTC (rev 780)
@@ -60,6 +60,7 @@
 # set of parameters:
 TESTS =\
    tests/pngtest\
+   tests/pngtest-badpngs\
    tests/pngvalid-gamma-16-to-8 tests/pngvalid-gamma-alpha-mode\
    tests/pngvalid-gamma-background tests/pngvalid-gamma-expand16-alpha-mode\
    tests/pngvalid-gamma-expand16-background\

Modified: branches/stable/source/src/libs/libpng/libpng-src/README
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/README	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/README	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,4 +1,4 @@
-README for libpng version 1.6.29 - March 16, 2017 (shared library 16.0)
+README for libpng version 1.6.34 - September 29, 2017 (shared library 16.0)
 See the note about version numbers near the top of png.h
 
 See INSTALL for instructions on how to install libpng.
@@ -23,7 +23,7 @@
 png_uint_32, which will affect shared-library applications that use
 this function.
 
-To avoid problems with changes to the internals of png info_struct,
+To avoid problems with changes to the internals of the png info_struct,
 new APIs have been made available in 0.95 to avoid direct application
 access to info_ptr.  These functions are the png_set_<chunk> and
 png_get_<chunk> functions.  These functions should be used when
@@ -88,11 +88,11 @@
 
 You may also want a copy of the PNG specification.  It is available
 as an RFC, a W3C Recommendation, and an ISO/IEC Standard.  You can find
-these at http://www.libpng.org/pub/png/documents/
+these at http://www.libpng.org/pub/png/pngdocs.html .
 
-This code is currently being archived at libpng.sf.net in the
-[DOWNLOAD] area, and at ftp://ftp.simplesystems.org.  If you can't find it
-in any of those places, e-mail me, and I'll help you find it.
+This code is currently being archived at libpng.sourceforge.io in the
+[DOWNLOAD] area, and at http://libpng.download/src .  If you
+can't find it in any of those places, e-mail me, and I'll help you find it.
 
 I am not a lawyer, but I believe that the Export Control Classification
 Number (ECCN) for libpng is EAR99, which means not subject to export

Modified: branches/stable/source/src/libs/libpng/libpng-src/arm/filter_neon.S
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/arm/filter_neon.S	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/arm/filter_neon.S	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,9 +1,9 @@
 
 /* filter_neon.S - NEON optimised filter functions
  *
- * Copyright (c) 2014 Glenn Randers-Pehrson
+ * Copyright (c) 2014,2017 Glenn Randers-Pehrson
  * Written by Mans Rullgard, 2011.
- * Last changed in libpng 1.6.16 [December 22, 2014]
+ * Last changed in libpng 1.6.31 [July 27, 2017]
  *
  * This code is released under the libpng license.
  * For conditions of distribution and use, see the disclaimer
@@ -16,7 +16,7 @@
 #define PNG_VERSION_INFO_ONLY
 #include "../pngpriv.h"
 
-#if defined(__linux__) && defined(__ELF__)
+#if (defined(__linux__) || defined(__FreeBSD__)) && defined(__ELF__)
 .section .note.GNU-stack,"",%progbits /* mark stack as non-executable */
 #endif
 

Modified: branches/stable/source/src/libs/libpng/libpng-src/configure.ac
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/configure.ac	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/configure.ac	2017-11-01 18:15:56 UTC (rev 780)
@@ -25,7 +25,7 @@
 
 dnl Version number stuff here:
 
-AC_INIT([libpng],[1.6.29],[png-mng-implement at lists.sourceforge.net])
+AC_INIT([libpng],[1.6.34],[png-mng-implement at lists.sourceforge.net])
 AC_CONFIG_MACRO_DIR([scripts])
 
 # libpng does not follow GNU file name conventions (hence 'foreign')
@@ -46,10 +46,10 @@
 dnl AM_PREREQ([1.11.2])
 dnl stop configure from automagically running automake
 
-PNGLIB_VERSION=1.6.29
+PNGLIB_VERSION=1.6.34
 PNGLIB_MAJOR=1
 PNGLIB_MINOR=6
-PNGLIB_RELEASE=28
+PNGLIB_RELEASE=34
 
 dnl End of version number stuff
 
@@ -300,6 +300,55 @@
 # HOST SPECIFIC OPTIONS
 # =====================
 #
+# DEFAULT
+# =======
+#
+AC_ARG_ENABLE([hardware-optimizations],
+   AS_HELP_STRING([[[--enable-hardware-optimizations]]],
+      [Enable hardware optimizations: =no/off, yes/on:]),
+   [case "$enableval" in
+      no|off)
+         # disable hardware optimization on all systems:
+         enable_arm_neon=no
+         AC_DEFINE([PNG_ARM_NEON_OPT], [0],
+           [Disable ARM_NEON optimizations])
+         enable_mips_msa=no
+         AC_DEFINE([PNG_MIPS_MSA_OPT], [0],
+           [Disable MIPS_MSA optimizations])
+         enable_powerpc_vsx=no
+         AC_DEFINE([PNG_POWERPC_VSX_OPT], [0],
+           [Disable POWERPC VSX optimizations])
+         enable_intel_sse=no
+         AC_DEFINE([PNG_INTEL_SSE_OPT], [0],
+           [Disable INTEL_SSE optimizations])
+         ;;
+      *)
+         # allow enabling hardware optimization on any system:
+         case "$host_cpu" in
+            arm*|aarch64*)
+              enable_arm_neon=yes
+              AC_DEFINE([PNG_ARM_NEON_OPT], [0],
+                [Enable ARM_NEON optimizations])
+              ;;
+            mipsel*|mips64el*)
+              enable_mips_msa=yes
+              AC_DEFINE([PNG_MIPS_MSA_OPT], [0],
+                [Enable MIPS_MSA optimizations])
+              ;;
+            i?86|x86_64)
+              enable_intel_sse=yes
+              AC_DEFINE([PNG_INTEL_SSE_OPT], [1],
+                [Enable Intel SSE optimizations])
+              ;;
+            powerpc*|ppc64*)
+              enable_powerpc_vsx=yes
+              AC_DEFINE([PNG_POWERPC_VSX_OPT], [2],
+                [Enable POWERPC VSX optimizations])
+              ;;
+         esac
+         ;;
+   esac])
+
 # ARM
 # ===
 #

Modified: branches/stable/source/src/libs/libpng/libpng-src/contrib/arm-neon/android-ndk.c
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/contrib/arm-neon/android-ndk.c	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/contrib/arm-neon/android-ndk.c	2017-11-01 18:15:56 UTC (rev 780)
@@ -17,7 +17,7 @@
  *
  * Documentation:
  *    http://www.kandroid.org/ndk/docs/CPU-ARM-NEON.html
- *    http://code.google.com/p/android/issues/detail?id=49065
+ *    https://code.google.com/p/android/issues/detail?id=49065
  *
  * NOTE: this requires that libpng is built against the Android NDK and linked
  * with an implementation of the Android ARM 'cpu-features' library.  The code

Modified: branches/stable/source/src/libs/libpng/libpng-src/contrib/arm-neon/linux.c
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/contrib/arm-neon/linux.c	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/contrib/arm-neon/linux.c	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,8 +1,8 @@
 /* contrib/arm-neon/linux.c
  *
- * Copyright (c) 2014 Glenn Randers-Pehrson
- * Written by John Bowler, 2014.
- * Last changed in libpng 1.6.16 [December 22, 2014]
+ * Last changed in libpng 1.6.31 [July 27, 2017]
+ * Copyright (c) 2014, 2017 Glenn Randers-Pehrson
+ * Written by John Bowler, 2014, 2017.
  *
  * This code is released under the libpng license.
  * For conditions of distribution and use, see the disclaimer
@@ -62,7 +62,7 @@
 
                counter=0;
                state = Feature;
-               /* FALL THROUGH */
+               /* FALLTHROUGH */
 
             case Feature:
                /* Match 'FEATURE', ASCII case insensitive. */
@@ -75,7 +75,7 @@
 
                /* did not match 'feature' */
                state = SkipLine;
-               /* FALL THROUGH */
+               /* FALLTHROUGH */
 
             case SkipLine:
             skipLine:
@@ -110,7 +110,7 @@
 
                state = Neon;
                counter = 0;
-               /* FALL THROUGH */
+               /* FALLTHROUGH */
 
             case Neon:
                /* Look for 'neon' tag */
@@ -122,7 +122,7 @@
                }
 
                state = SkipTag;
-               /* FALL THROUGH */
+               /* FALLTHROUGH */
 
             case SkipTag:
                /* Skip non-space characters */

Modified: branches/stable/source/src/libs/libpng/libpng-src/contrib/examples/pngtopng.c
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/contrib/examples/pngtopng.c	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/contrib/examples/pngtopng.c	2017-11-01 18:15:56 UTC (rev 780)
@@ -5,7 +5,7 @@
  * related or neighboring rights to this work.  This work is published from:
  * United States.
  *
- * Last changed in libpng 1.6.29 [%RDATE%]
+ * Last changed in libpng 1.6.29 [March 16, 2017]
  *
  * Read a PNG and write it out in a fixed format, using the 'simplified API'
  * that was introduced in libpng-1.6.0.

Modified: branches/stable/source/src/libs/libpng/libpng-src/contrib/gregbook/README
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/contrib/gregbook/README	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/contrib/gregbook/README	2017-11-01 18:15:56 UTC (rev 780)
@@ -55,7 +55,7 @@
 13-15 of the book for detailed discussion of the three programs.
 
 Greg Roelofs
-http://pobox.com/~newt/greg_contact.html
+https://pobox.com/~newt/greg_contact.html
 16 March 2008
 
 
@@ -63,7 +63,7 @@
 
  - Prerequisites (in order of compilation):
 
-      - zlib            http://zlib.net/
+      - zlib            https://zlib.net/
       - libpng          http://www.libpng.org/pub/png/libpng.html
       - pngbook         http://www.libpng.org/pub/png/book/sources.html
 

Modified: branches/stable/source/src/libs/libpng/libpng-src/contrib/gregbook/readpng.c
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/contrib/gregbook/readpng.c	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/contrib/gregbook/readpng.c	2017-11-01 18:15:56 UTC (rev 780)
@@ -4,7 +4,7 @@
 
   ---------------------------------------------------------------------------
 
-      Copyright (c) 1998-2007 Greg Roelofs.  All rights reserved.
+      Copyright (c) 1998-2007,2017 Greg Roelofs.  All rights reserved.
 
       This software is provided "as is," without warranty of any kind,
       express or implied.  In no event shall the author or contributors
@@ -264,6 +264,12 @@
     *pRowbytes = rowbytes = png_get_rowbytes(png_ptr, info_ptr);
     *pChannels = (int)png_get_channels(png_ptr, info_ptr);
 
+    /* Guard against integer overflow */
+    if (height > ((size_t)(-1))/rowbytes) {
+        fprintf(stderr, "readpng:  image_data buffer would be too large\n",
+        return NULL;
+    }
+
     if ((image_data = (uch *)malloc(rowbytes*height)) == NULL) {
         png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
         return NULL;

Modified: branches/stable/source/src/libs/libpng/libpng-src/contrib/gregbook/readpng2.c
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/contrib/gregbook/readpng2.c	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/contrib/gregbook/readpng2.c	2017-11-01 18:15:56 UTC (rev 780)
@@ -55,6 +55,7 @@
 
    Changelog:
      2015-11-12 - Check return value of png_get_bKGD() (Glenn R-P)
+     2017-04-22 - Guard against integer overflow (Glenn R-P)
 
   ---------------------------------------------------------------------------*/
 

Modified: branches/stable/source/src/libs/libpng/libpng-src/contrib/gregbook/readppm.c
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/contrib/gregbook/readppm.c	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/contrib/gregbook/readppm.c	2017-11-01 18:15:56 UTC (rev 780)
@@ -9,7 +9,7 @@
 
   ---------------------------------------------------------------------------
 
-      Copyright (c) 1998-2007 Greg Roelofs.  All rights reserved.
+      Copyright (c) 1998-2007,2017 Greg Roelofs.  All rights reserved.
 
       This software is provided "as is," without warranty of any kind,
       express or implied.  In no event shall the author or contributors
@@ -154,13 +154,18 @@
     *pRowbytes = rowbytes = channels*width;
     *pChannels = channels;
 
+    Trace((stderr, "readpng_get_image:  rowbytes = %ld, height = %ld\n", rowbytes, height));
+
+    /* Guard against integer overflow */
+    if (height > ((size_t)(-1))/rowbytes) {
+        fprintf(stderr, PROGNAME ":  image_data buffer would be too large\n",
+        return NULL;
+    }
+
     if ((image_data = (uch *)malloc(rowbytes*height)) == NULL) {
         return NULL;
     }
 
-    Trace((stderr, "readpng_get_image:  rowbytes = %ld, height = %ld\n", rowbytes, height));
-
-
     /* now we can go ahead and just read the whole image */
 
     if (fread(image_data, 1L, rowbytes*height, saved_infile) <

Modified: branches/stable/source/src/libs/libpng/libpng-src/contrib/gregbook/rpng-win.c
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/contrib/gregbook/rpng-win.c	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/contrib/gregbook/rpng-win.c	2017-11-01 18:15:56 UTC (rev 780)
@@ -24,10 +24,11 @@
     - 1.10:  enabled "message window"/console (thanks to David Geldreich)
     - 2.00:  dual-licensed (added GNU GPL)
     - 2.01:  fixed improper display of usage screen on PNG error(s)
+    - 2.02:  check for integer overflow (Glenn R-P)
 
   ---------------------------------------------------------------------------
 
-      Copyright (c) 1998-2008 Greg Roelofs.  All rights reserved.
+      Copyright (c) 1998-2008, 2017 Greg Roelofs.  All rights reserved.
 
       This software is provided "as is," without warranty of any kind,
       express or implied.  In no event shall the author or contributors
@@ -496,6 +497,12 @@
 
     wimage_rowbytes = ((3*image_width + 3L) >> 2) << 2;
 
+    /* Guard against integer overflow */
+    if (image_height > ((size_t)(-1))/wimage_rowbytes) {
+        fprintf(stderr, PROGNAME ":  image_data buffer would be too large\n");
+        return 4;   /* fail */
+    }
+
     if (!(dib = (uch *)malloc(sizeof(BITMAPINFOHEADER) +
                               wimage_rowbytes*image_height)))
     {

Modified: branches/stable/source/src/libs/libpng/libpng-src/contrib/gregbook/rpng-x.c
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/contrib/gregbook/rpng-x.c	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/contrib/gregbook/rpng-x.c	2017-11-01 18:15:56 UTC (rev 780)
@@ -28,10 +28,11 @@
     - 2.01:  fixed improper display of usage screen on PNG error(s)
     - 2.02:  Added "void(argc);" statement to quiet pedantic compiler warnings
              about unused variable (GR-P)
+    - 2.03:  check for integer overflow (Glenn R-P)
 
   ---------------------------------------------------------------------------
 
-      Copyright (c) 1998-2008 Greg Roelofs.  All rights reserved.
+      Copyright (c) 1998-2008, 2017 Greg Roelofs.  All rights reserved.
 
       This software is provided "as is," without warranty of any kind,
       express or implied.  In no event shall the author or contributors

Modified: branches/stable/source/src/libs/libpng/libpng-src/contrib/gregbook/rpng2-win.c
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/contrib/gregbook/rpng2-win.c	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/contrib/gregbook/rpng2-win.c	2017-11-01 18:15:56 UTC (rev 780)
@@ -33,12 +33,11 @@
     - 2.02:  fixed improper display of usage screen on PNG error(s); fixed
               unexpected-EOF and file-read-error cases
     - 2.03:  removed runtime MMX-enabling/disabling and obsolete -mmx* options
-    - 2.04:
-             (GR-P)
+    - 2.04:  check for integer overflow (Glenn R-P)
 
   ---------------------------------------------------------------------------
 
-      Copyright (c) 1998-2008 Greg Roelofs.  All rights reserved.
+      Copyright (c) 1998-2008, 2017 Greg Roelofs.  All rights reserved.
 
       This software is provided "as is," without warranty of any kind,
       express or implied.  In no event shall the author or contributors
@@ -650,6 +649,13 @@
     Trace((stderr, "  width  = %ld\n", rpng2_info.width))
     Trace((stderr, "  height = %ld\n", rpng2_info.height))
 
+    /* Guard against integer overflow */
+    if (rpng2_info.height > ((size_t)(-1))/rowbytes) {
+        fprintf(stderr, PROGNAME ":  image_data buffer would be too large\n",
+        readpng2_cleanup(&rpng2_info);
+        return;
+    }
+
     rpng2_info.image_data = (uch *)malloc(rowbytes * rpng2_info.height);
     if (!rpng2_info.image_data) {
         readpng2_cleanup(&rpng2_info);

Modified: branches/stable/source/src/libs/libpng/libpng-src/contrib/gregbook/rpng2-x.c
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/contrib/gregbook/rpng2-x.c	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/contrib/gregbook/rpng2-x.c	2017-11-01 18:15:56 UTC (rev 780)
@@ -44,9 +44,11 @@
     - 2.04:  Added "void(foo);" statements to quiet pedantic compiler warnings
              about unused variables (GR-P)
     - 2.05:  Use nanosleep() instead of usleep(), which is deprecated (GR-P).
+    - 2.06:  check for integer overflow (Glenn R-P)
   ---------------------------------------------------------------------------
 
-      Copyright (c) 1998-2010, 2014-2015 Greg Roelofs.  All rights reserved.
+      Copyright (c) 1998-2010, 2014-2015, 2017 Greg Roelofs.  All rights
+      reserved.
 
       This software is provided "as is," without warranty of any kind,
       express or implied.  In no event shall the author or contributors
@@ -780,6 +782,13 @@
     Trace((stderr, "  width  = %ld\n", rpng2_info.width))
     Trace((stderr, "  height = %ld\n", rpng2_info.height))
 
+    /* Guard against integer overflow */
+    if (rpng2_info.height > ((size_t)(-1))/rpng2_info.rowbytes) {
+        fprintf(stderr, PROGNAME ":  image_data buffer would be too large\n");
+        readpng2_cleanup(&rpng2_info);
+        return;
+    }
+
     rpng2_info.image_data = (uch *)malloc(rowbytes * rpng2_info.height);
     if (!rpng2_info.image_data) {
         readpng2_cleanup(&rpng2_info);

Modified: branches/stable/source/src/libs/libpng/libpng-src/contrib/gregbook/wpng.c
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/contrib/gregbook/wpng.c	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/contrib/gregbook/wpng.c	2017-11-01 18:15:56 UTC (rev 780)
@@ -29,6 +29,7 @@
     - 1.04:  fixed DOS/OS2/Win32 detection, including partial Cygwin fix
               (see http://home.att.net/~perlspinr/diffs/GregBook_cygwin.diff)
     - 2.00:  dual-licensed (added GNU GPL)
+    - 2.01:  check for integer overflow (Glenn R-P)
 
         [REPORTED BUG (win32 only):  "contrib/gregbook/wpng.c - cmd line
          dose not work!  In order to do something useful I needed to redirect
@@ -38,7 +39,7 @@
 
   ---------------------------------------------------------------------------
 
-      Copyright (c) 1998-2007 Greg Roelofs.  All rights reserved.
+      Copyright (c) 1998-2007, 2017 Greg Roelofs.  All rights reserved.
 
       This software is provided "as is," without warranty of any kind,
       express or implied.  In no event shall the author or contributors
@@ -702,8 +703,19 @@
     if (wpng_info.interlaced) {
         long i;
         ulg bytes;
-        ulg image_bytes = rowbytes * wpng_info.height;   /* overflow? */
+        ulg image_bytes;
 
+        /* Guard against integer overflow */
+        if (wpng_info_height > ((size_t)(-1)/rowbytes ||
+            wpng_info_height > ((ulg)(-1)/rowbytes) {
+            fprintf(stderr, PROGNAME ":  image_data buffer too large\n");
+            writepng_cleanup(&wpng_info);
+            wpng_cleanup();
+            exit(5);
+        }
+
+        image_bytes = rowbytes * wpng_info.height;
+
         wpng_info.image_data = (uch *)malloc(image_bytes);
         wpng_info.row_pointers = (uch **)malloc(wpng_info.height*sizeof(uch *));
         if (wpng_info.image_data == NULL || wpng_info.row_pointers == NULL) {

Modified: branches/stable/source/src/libs/libpng/libpng-src/contrib/gregbook/writepng.c
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/contrib/gregbook/writepng.c	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/contrib/gregbook/writepng.c	2017-11-01 18:15:56 UTC (rev 780)
@@ -4,7 +4,7 @@
 
   ---------------------------------------------------------------------------
 
-      Copyright (c) 1998-2007 Greg Roelofs.  All rights reserved.
+      Copyright (c) 1998-2007, 2017 Greg Roelofs.  All rights reserved.
 
       This software is provided "as is," without warranty of any kind,
       express or implied.  In no event shall the author or contributors

Modified: branches/stable/source/src/libs/libpng/libpng-src/contrib/libtests/pngstest.c
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/contrib/libtests/pngstest.c	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/contrib/libtests/pngstest.c	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,10 +1,9 @@
 /*-
  * pngstest.c
  *
- * Copyright (c) 2013-2016 John Cunningham Bowler
+ * Last changed in libpng 1.6.31 [July 27, 2017]
+ * Copyright (c) 2013-2017 John Cunningham Bowler
  *
- * Last changed in libpng 1.6.24 [August 4, 2016]
- *
  * This code is released under the libpng license.
  * For conditions of distribution and use, see the disclaimer
  * and license in png.h
@@ -2611,9 +2610,9 @@
    const unsigned int b_sample = PNG_IMAGE_SAMPLE_SIZE(formatb);
    int alpha_added, alpha_removed;
    int bchannels;
-   int btoa[4];
    png_uint_32 y;
    Transform tr;
+   int btoa[4]={0,0,0,0};
 
    /* This should never happen: */
    if (width != b->image.width || height != b->image.height)
@@ -2746,22 +2745,27 @@
        */
       else if ((a->opts & ACCUMULATE) == 0)
       {
+#        ifdef __GNUC__
+#           define BYTE_CHARS 20 /* 2^32: GCC sprintf warning */
+#        else
+#           define BYTE_CHARS 3 /* 2^8: real maximum value */
+#        endif
          /* Check the original image first,
           * TODO: deal with input images with bad pixel values?
           */
          if (amax >= a->image.colormap_entries)
          {
-            char pindex[9];
-            sprintf(pindex, "%d[%lu]", amax,
-               (unsigned long)a->image.colormap_entries);
+            char pindex[3+2*BYTE_CHARS];
+            sprintf(pindex, "%d[%u]", amax,
+               (png_byte)/*SAFE*/a->image.colormap_entries);
             return logerror(a, a->file_name, ": bad pixel index: ", pindex);
          }
 
          else if (bmax >= b->image.colormap_entries)
          {
-            char pindex[9];
-            sprintf(pindex, "%d[%lu]", bmax,
-               (unsigned long)b->image.colormap_entries);
+            char pindex[3+2*BYTE_CHARS];
+            sprintf(pindex, "%d[%u]", bmax,
+               (png_byte)/*SAFE*/b->image.colormap_entries);
             return logerror(b, b->file_name, ": bad pixel index: ", pindex);
          }
       }
@@ -2881,10 +2885,13 @@
                {
                   case 4:
                      if (pua[btoa[3]] != pub[3]) break;
+                     /* FALLTHROUGH */
                   case 3:
                      if (pua[btoa[2]] != pub[2]) break;
+                     /* FALLTHROUGH */
                   case 2:
                      if (pua[btoa[1]] != pub[1]) break;
+                     /* FALLTHROUGH */
                   case 1:
                      if (pua[btoa[0]] != pub[0]) break;
                      if (alpha_added != 4 && pub[alpha_added] != 65535) break;
@@ -2900,10 +2907,13 @@
                {
                   case 4:
                      if (psa[btoa[3]] != psb[3]) break;
+                     /* FALLTHROUGH */
                   case 3:
                      if (psa[btoa[2]] != psb[2]) break;
+                     /* FALLTHROUGH */
                   case 2:
                      if (psa[btoa[1]] != psb[1]) break;
+                     /* FALLTHROUGH */
                   case 1:
                      if (psa[btoa[0]] != psb[0]) break;
                      if (alpha_added != 4 && psb[alpha_added] != 255) break;

Modified: branches/stable/source/src/libs/libpng/libpng-src/contrib/libtests/pngunknown.c
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/contrib/libtests/pngunknown.c	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/contrib/libtests/pngunknown.c	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,8 +1,8 @@
 
 /* pngunknown.c - test the read side unknown chunk handling
  *
- * Last changed in libpng 1.6.26 [October 20, 2016]
- * Copyright (c) 2015,2016 Glenn Randers-Pehrson
+ * Last changed in libpng 1.6.32 [August 24, 2017]
+ * Copyright (c) 2015,2017 Glenn Randers-Pehrson
  * Written by John Cunningham Bowler
  *
  * This code is released under the libpng license.
@@ -114,6 +114,7 @@
 #define png_PLTE PNG_U32( 80,  76,  84,  69)
 #define png_bKGD PNG_U32( 98,  75,  71,  68)
 #define png_cHRM PNG_U32( 99,  72,  82,  77)
+#define png_eXIf PNG_U32(101,  88,  73, 102) /* registered July 2017 */
 #define png_fRAc PNG_U32(102,  82,  65,  99) /* registered, not defined */
 #define png_gAMA PNG_U32(103,  65,  77,  65)
 #define png_gIFg PNG_U32(103,  73,  70, 103)
@@ -210,6 +211,13 @@
          1,
 #     endif
       1,  START, 0 },
+   { "eXIf", PNG_INFO_eXIf, png_eXIf,
+#     ifdef PNG_READ_eXIf_SUPPORTED
+         0,
+#     else
+         1,
+#     endif
+      1,  END, 0 },
    { "gAMA", PNG_INFO_gAMA, png_gAMA,
 #     ifdef PNG_READ_gAMA_SUPPORTED
          0,
@@ -614,7 +622,7 @@
                   ++(d->error_count);
                   break;
                }
-               /* FALL THROUGH (safe) */
+               /* FALLTHROUGH */ /* (safe) */
             case PNG_HANDLE_CHUNK_ALWAYS:
                break;
          }
@@ -1090,7 +1098,7 @@
  "sTER", "sTER=if-safe", 0,
  "IDAT", "default=discard", "IDAT=save", 0,
  "sAPI", "bKGD=save", "cHRM=save", "gAMA=save", "all=discard", "iCCP=save",
-   "sBIT=save", "sRGB=save", 0,
+   "sBIT=save", "sRGB=save", "eXIf=save", 0,
  0/*end*/
 };
 

Modified: branches/stable/source/src/libs/libpng/libpng-src/contrib/libtests/pngvalid.c
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/contrib/libtests/pngvalid.c	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/contrib/libtests/pngvalid.c	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,7 +1,7 @@
 
 /* pngvalid.c - validate libpng by constructing then reading png files.
  *
- * Last changed in libpng 1.6.29 [March 16, 2017]
+ * Last changed in libpng 1.6.31 [July 27, 2017]
  * Copyright (c) 2014-2017 John Cunningham Bowler
  *
  * This code is released under the libpng license.
@@ -6584,16 +6584,16 @@
    {
    case PNG_COLOR_TYPE_PALETTE:
       if (dp->output_bit_depth > 8) goto error;
-      /*FALL THROUGH*/
+      /* FALLTHROUGH */
    case PNG_COLOR_TYPE_GRAY:
       if (dp->output_bit_depth == 1 || dp->output_bit_depth == 2 ||
          dp->output_bit_depth == 4)
          break;
-      /*FALL THROUGH*/
+      /* FALLTHROUGH */
    default:
       if (dp->output_bit_depth == 8 || dp->output_bit_depth == 16)
          break;
-      /*FALL THROUGH*/
+      /* FALLTHROUGH */
    error:
       {
          char message[128];
@@ -9994,9 +9994,9 @@
                case PNG_BACKGROUND_GAMMA_FILE:
                case PNG_BACKGROUND_GAMMA_UNIQUE:
                   use_background = (alpha >= 0 && alpha < 1);
-                  /*FALL THROUGH*/
 #           endif
 #           ifdef PNG_READ_ALPHA_MODE_SUPPORTED
+               /* FALLTHROUGH */
                case ALPHA_MODE_OFFSET + PNG_ALPHA_STANDARD:
                case ALPHA_MODE_OFFSET + PNG_ALPHA_BROKEN:
                case ALPHA_MODE_OFFSET + PNG_ALPHA_OPTIMIZED:

Added: branches/stable/source/src/libs/libpng/libpng-src/contrib/oss-fuzz/Dockerfile
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/contrib/oss-fuzz/Dockerfile	                        (rev 0)
+++ branches/stable/source/src/libs/libpng/libpng-src/contrib/oss-fuzz/Dockerfile	2017-11-01 18:15:56 UTC (rev 780)
@@ -0,0 +1,24 @@
+# Copyright 2016 Google Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+################################################################################
+
+FROM gcr.io/oss-fuzz-base/base-builder
+MAINTAINER glennrp at gmail.com
+RUN apt-get update && apt-get install -y make autoconf automake libtool zlib1g-dev
+
+RUN git clone --depth 1 https://github.com/glennrp/libpng.git
+RUN (cd libpng; git log | head -1)
+WORKDIR libpng
+COPY build.sh $SRC/

Added: branches/stable/source/src/libs/libpng/libpng-src/contrib/oss-fuzz/README.txt
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/contrib/oss-fuzz/README.txt	                        (rev 0)
+++ branches/stable/source/src/libs/libpng/libpng-src/contrib/oss-fuzz/README.txt	2017-11-01 18:15:56 UTC (rev 780)
@@ -0,0 +1,37 @@
+Last changed in libpng 1.6.33 [September 28, 2017]
+Copyright (c) 2017 Glenn Randers-Pehrson
+
+This code is released under the libpng license.
+For conditions of distribution and use, see the disclaimer
+and license in png.h
+
+Files in this directory are used by the oss-fuzz project
+(https://github.com/google/oss-fuzz/tree/master/projects/libpng).
+for "fuzzing" libpng.
+
+They were licensed by Google Inc, using the BSD-like Chromium license,
+which may be found at https://cs.chromium.org/chromium/src/LICENSE, or, if
+noted in the source, under the Apache-2.0 license, which may
+be found at http://www.apache.org/licenses/LICENSE-2.0 .
+If they have been modified, the derivatives are copyright Glenn Randers-Pehrson
+and are released under the same licenses as the originals.  Several of
+the original files (libpng_read_fuzzer.options, png.dict, project.yaml)
+had no licensing information; we assumed that these were under the Chromium
+license. Any new files are released under the libpng license (see png.h).
+
+The files are
+                            Original
+ Filename                   or derived   Copyright          License
+ =========================  ==========   ================   ==========
+ Dockerfile*                derived      2017, Glenn R-P    Apache 2.0
+ build.sh*                  derived      2017, Glenn R-P    Apache 2.0
+ libpng_read_fuzzer.cc      derived      2017, Glenn R-P    Chromium
+ libpng_read_fuzzer.options original     2015, Chrome Devs  Chromium
+ png.dict                   original     2015, Chrome Devs  Chromium
+ README.txt (this file)     original     2017, Glenn R-P    libpng
+
+ * Dockerfile and build.sh are copies of the files used by oss-fuzz.
+   png.dict and libpng_read_fuzzer.* are the actual files used by oss-fuzz,
+   which retrieves them from the libpng repository at Github.
+
+To do: exercise the progressive reader and the png encoder.


Property changes on: branches/stable/source/src/libs/libpng/libpng-src/contrib/oss-fuzz/README.txt
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: branches/stable/source/src/libs/libpng/libpng-src/contrib/oss-fuzz/build.sh
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/contrib/oss-fuzz/build.sh	                        (rev 0)
+++ branches/stable/source/src/libs/libpng/libpng-src/contrib/oss-fuzz/build.sh	2017-11-01 18:15:56 UTC (rev 780)
@@ -0,0 +1,50 @@
+#!/bin/bash -eu
+# Copyright 2017 Glenn Randers-Pehrson
+# Copyright 2016 Google Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# Last changed in libpng 1.6.33 [September 28, 2017]
+#
+# Revisions by Glenn Randers-Pehson, 2017:
+# 1. Build only the library, not the tools (changed "make -j$(nproc) all" to
+#     "make -j$(nproc) libpng16.la").
+# 2. Disabled WARNING and WRITE options in pnglibconf.dfa.
+################################################################################
+
+# Disable logging via library build configuration control.
+cat scripts/pnglibconf.dfa | \
+  sed -e "s/option STDIO/option STDIO disabled/" \
+      -e "s/option WARNING /option WARNING disabled/" \
+      -e "s/option WRITE enables WRITE_INT_FUNCTIONS/option WRITE disabled/" \
+> scripts/pnglibconf.dfa.temp
+mv scripts/pnglibconf.dfa.temp scripts/pnglibconf.dfa
+
+# build the library.
+autoreconf -f -i
+./configure
+make -j$(nproc) clean
+make -j$(nproc) libpng16.la
+
+# build libpng_read_fuzzer.
+$CXX $CXXFLAGS -std=c++11 -I. \
+     $SRC/libpng/contrib/oss-fuzz/libpng_read_fuzzer.cc \
+     -o $OUT/libpng_read_fuzzer \
+     -lFuzzingEngine .libs/libpng16.a -lz
+
+# add seed corpus.
+find $SRC/libpng -name "*.png" | grep -v crashers | \
+     xargs zip $OUT/libpng_read_fuzzer_seed_corpus.zip
+
+cp $SRC/libpng/contrib/oss-fuzz/*.dict \
+     $SRC/libpng/contrib/oss-fuzz/*.options $OUT/


Property changes on: branches/stable/source/src/libs/libpng/libpng-src/contrib/oss-fuzz/build.sh
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: branches/stable/source/src/libs/libpng/libpng-src/contrib/oss-fuzz/libpng_read_fuzzer.cc
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/contrib/oss-fuzz/libpng_read_fuzzer.cc	                        (rev 0)
+++ branches/stable/source/src/libs/libpng/libpng-src/contrib/oss-fuzz/libpng_read_fuzzer.cc	2017-11-01 18:15:56 UTC (rev 780)
@@ -0,0 +1,180 @@
+
+// libpng_read_fuzzer.cc
+// Copyright 2017 Glenn Randers-Pehrson
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that may
+// be found in the LICENSE file https://cs.chromium.org/chromium/src/LICENSE
+
+// Last changed in libpng 1.6.32 [August 24, 2017]
+
+// The modifications in 2017 by Glenn Randers-Pehrson include
+// 1. addition of a PNG_CLEANUP macro,
+// 2. setting the option to ignore ADLER32 checksums,
+// 3. adding "#include <string.h>" which is needed on some platforms
+//    to provide memcpy().
+// 4. adding read_end_info() and creating an end_info structure.
+
+#include <stddef.h>
+#include <stdint.h>
+#include <string.h>
+
+#include <vector>
+
+#define PNG_INTERNAL
+#include "png.h"
+
+#define PNG_CLEANUP \
+  if(png_handler.png_ptr) \
+  { \
+    if (png_handler.row_ptr) \
+      png_free(png_handler.png_ptr, png_handler.row_ptr); \
+    if (png_handler.end_info_ptr) \
+      png_destroy_read_struct(&png_handler.png_ptr, &png_handler.info_ptr,\
+        &png_handler.end_info_ptr); \
+    else if (png_handler.info_ptr) \
+      png_destroy_read_struct(&png_handler.png_ptr, &png_handler.info_ptr,\
+        nullptr); \
+    else \
+      png_destroy_read_struct(&png_handler.png_ptr, nullptr, nullptr); \
+    png_handler.png_ptr = nullptr; \
+    png_handler.row_ptr = nullptr; \
+    png_handler.info_ptr = nullptr; \
+    png_handler.end_info_ptr = nullptr; \
+  }
+
+struct BufState {
+  const uint8_t* data;
+  size_t bytes_left;
+};
+
+struct PngObjectHandler {
+  png_infop info_ptr = nullptr;
+  png_structp png_ptr = nullptr;
+  png_infop end_info_ptr = nullptr;
+  png_voidp row_ptr = nullptr;
+  BufState* buf_state = nullptr;
+
+  ~PngObjectHandler() {
+    if (row_ptr)
+      png_free(png_ptr, row_ptr);
+    if (end_info_ptr)
+      png_destroy_read_struct(&png_ptr, &info_ptr, &end_info_ptr);
+    else if (info_ptr) 
+      png_destroy_read_struct(&png_ptr, &info_ptr, nullptr);
+    else
+      png_destroy_read_struct(&png_ptr, nullptr, nullptr);
+    delete buf_state;
+  }
+};
+
+void user_read_data(png_structp png_ptr, png_bytep data, png_size_t length) {
+  BufState* buf_state = static_cast<BufState*>(png_get_io_ptr(png_ptr));
+  if (length > buf_state->bytes_left) {
+    png_error(png_ptr, "read error");
+  }
+  memcpy(data, buf_state->data, length);
+  buf_state->bytes_left -= length;
+  buf_state->data += length;
+}
+
+static const int kPngHeaderSize = 8;
+
+// Entry point for LibFuzzer.
+// Roughly follows the libpng book example:
+// http://www.libpng.org/pub/png/book/chapter13.html
+extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
+  if (size < kPngHeaderSize) {
+    return 0;
+  }
+
+  std::vector<unsigned char> v(data, data + size);
+  if (png_sig_cmp(v.data(), 0, kPngHeaderSize)) {
+    // not a PNG.
+    return 0;
+  }
+
+  PngObjectHandler png_handler;
+  png_handler.png_ptr = nullptr;
+  png_handler.row_ptr = nullptr;
+  png_handler.info_ptr = nullptr;
+  png_handler.end_info_ptr = nullptr;
+
+  png_handler.png_ptr = png_create_read_struct
+    (PNG_LIBPNG_VER_STRING, nullptr, nullptr, nullptr);
+  if (!png_handler.png_ptr) {
+    return 0;
+  }
+
+  png_handler.info_ptr = png_create_info_struct(png_handler.png_ptr);
+  if (!png_handler.info_ptr) {
+    PNG_CLEANUP
+    return 0;
+  }
+
+  png_handler.end_info_ptr = png_create_info_struct(png_handler.png_ptr);
+  if (!png_handler.end_info_ptr) {
+    PNG_CLEANUP
+    return 0;
+  }
+
+  png_set_crc_action(png_handler.png_ptr, PNG_CRC_QUIET_USE, PNG_CRC_QUIET_USE);
+#ifdef PNG_IGNORE_ADLER32
+  png_set_option(png_handler.png_ptr, PNG_IGNORE_ADLER32, PNG_OPTION_ON);
+#endif
+
+  // Setting up reading from buffer.
+  png_handler.buf_state = new BufState();
+  png_handler.buf_state->data = data + kPngHeaderSize;
+  png_handler.buf_state->bytes_left = size - kPngHeaderSize;
+  png_set_read_fn(png_handler.png_ptr, png_handler.buf_state, user_read_data);
+  png_set_sig_bytes(png_handler.png_ptr, kPngHeaderSize);
+
+  if (setjmp(png_jmpbuf(png_handler.png_ptr))) {
+    PNG_CLEANUP
+    return 0;
+  }
+
+  // Reading.
+  png_read_info(png_handler.png_ptr, png_handler.info_ptr);
+  png_handler.row_ptr = png_malloc(
+      png_handler.png_ptr, png_get_rowbytes(png_handler.png_ptr,
+                                               png_handler.info_ptr));
+
+  // reset error handler to put png_deleter into scope.
+  if (setjmp(png_jmpbuf(png_handler.png_ptr))) {
+    PNG_CLEANUP
+    return 0;
+  }
+
+  png_uint_32 width, height;
+  int bit_depth, color_type, interlace_type, compression_type;
+  int filter_type;
+
+  if (!png_get_IHDR(png_handler.png_ptr, png_handler.info_ptr, &width,
+                    &height, &bit_depth, &color_type, &interlace_type,
+                    &compression_type, &filter_type)) {
+    PNG_CLEANUP
+    return 0;
+  }
+
+  // This is going to be too slow.
+  if (width && height > 100000000 / width) {
+    PNG_CLEANUP
+    return 0;
+  }
+
+  int passes = png_set_interlace_handling(png_handler.png_ptr);
+  png_start_read_image(png_handler.png_ptr);
+
+  for (int pass = 0; pass < passes; ++pass) {
+    for (png_uint_32 y = 0; y < height; ++y) {
+      png_read_row(png_handler.png_ptr,
+                   static_cast<png_bytep>(png_handler.row_ptr), nullptr);
+    }
+  }
+
+  png_read_end(png_handler.png_ptr, png_handler.end_info_ptr);
+
+  PNG_CLEANUP
+  return 0;
+}


Property changes on: branches/stable/source/src/libs/libpng/libpng-src/contrib/oss-fuzz/libpng_read_fuzzer.cc
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: branches/stable/source/src/libs/libpng/libpng-src/contrib/oss-fuzz/libpng_read_fuzzer.options
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/contrib/oss-fuzz/libpng_read_fuzzer.options	                        (rev 0)
+++ branches/stable/source/src/libs/libpng/libpng-src/contrib/oss-fuzz/libpng_read_fuzzer.options	2017-11-01 18:15:56 UTC (rev 780)
@@ -0,0 +1,2 @@
+[libfuzzer]
+dict = png.dict

Added: branches/stable/source/src/libs/libpng/libpng-src/contrib/oss-fuzz/newcc
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/contrib/oss-fuzz/newcc	                        (rev 0)
+++ branches/stable/source/src/libs/libpng/libpng-src/contrib/oss-fuzz/newcc	2017-11-01 18:15:56 UTC (rev 780)
@@ -0,0 +1,190 @@
+
+// libpng_read_fuzzer.cc
+// Copyright 2017 Glenn Randers-Pehrson
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that may
+// be found in the LICENSE file https://cs.chromium.org/chromium/src/LICENSE
+
+// Last changed in libpng 1.6.33beta03 [September 27, 2017]
+
+// The modifications in 2017 by Glenn Randers-Pehrson include
+// 1. addition of a PNG_CLEANUP macro,
+// 2. setting the option to ignore ADLER32 checksums,
+// 3. adding "#include <string.h>" which is needed on some platforms
+//    to provide memcpy().
+// 4. adding read_end_info() and creating an end_info structure.
+
+#include <stddef.h>
+#include <stdint.h>
+#include <string.h>
+
+#include <vector>
+
+#define PNG_INTERNAL
+#include "png.h"
+
+struct BufState {
+  const uint8_t* data;
+  size_t bytes_left;
+};
+
+struct PngObjectHandler {
+  png_infop info_ptr = nullptr;
+  png_structp png_ptr = nullptr;
+  png_infop end_info_ptr = nullptr;
+  png_voidp row_ptr = nullptr;
+  BufState* buf_state = nullptr;
+
+  ~PngObjectHandler() {
+    if (row_ptr)
+      png_free(png_ptr, row_ptr);
+    if (end_info_ptr)
+      png_destroy_read_struct(&png_ptr, &info_ptr, &end_info_ptr);
+    else if (info_ptr) 
+      png_destroy_read_struct(&png_ptr, &info_ptr, nullptr);
+    else
+      png_destroy_read_struct(&png_ptr, nullptr, nullptr);
+    delete buf_state;
+  }
+};
+
+void user_read_data(png_structp png_ptr, png_bytep data, png_size_t length) {
+  BufState* buf_state = static_cast<BufState*>(png_get_io_ptr(png_ptr));
+  if (length > buf_state->bytes_left) {
+    png_error(png_ptr, "read error");
+  }
+  memcpy(data, buf_state->data, length);
+  buf_state->bytes_left -= length;
+  buf_state->data += length;
+}
+
+static const int kPngHeaderSize = 8;
+
+// Entry point for LibFuzzer.
+// Roughly follows the libpng book example:
+// http://www.libpng.org/pub/png/book/chapter13.html
+
+extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
+  if (size < kPngHeaderSize) {
+    return 0;
+  }
+
+  std::vector<unsigned char> v(data, data + size);
+  if (png_sig_cmp(v.data(), 0, kPngHeaderSize)) {
+    // not a PNG.
+    return 0;
+  }
+
+  PngObjectHandler png_handler;
+  png_handler.png_ptr = nullptr;
+  png_handler.row_ptr = nullptr;
+  png_handler.info_ptr = nullptr;
+  png_handler.end_info_ptr = nullptr;
+
+  png_handler.png_ptr = png_create_read_struct
+    (PNG_LIBPNG_VER_STRING, nullptr, nullptr, nullptr);
+  if (!png_handler.png_ptr) {
+    return 0;
+  }
+
+#define PNG_CLEANUP \
+  if(png_handler.png_ptr) \
+  { \
+    if (png_handler.row_ptr) \
+      png_free(png_handler.png_ptr, png_handler.row_ptr); \
+    if (png_handler.end_info_ptr) \
+      png_destroy_read_struct(&png_handler.png_ptr, &png_handler.info_ptr,\
+        &png_handler.end_info_ptr); \
+    else if (png_handler.info_ptr) \
+      png_destroy_read_struct(&png_handler.png_ptr, &png_handler.info_ptr,\
+        nullptr); \
+    else \
+      png_destroy_read_struct(&png_handler.png_ptr, nullptr, nullptr); \
+    png_handler.png_ptr = nullptr; \
+    png_handler.row_ptr = nullptr; \
+    png_handler.info_ptr = nullptr; \
+    png_handler.end_info_ptr = nullptr; \
+  }
+
+  png_handler.info_ptr = png_create_info_struct(png_handler.png_ptr);
+  if (!png_handler.info_ptr) {
+    PNG_CLEANUP
+    return 0;
+  }
+
+  png_handler.end_info_ptr = png_create_info_struct(png_handler.png_ptr);
+  if (!png_handler.end_info_ptr) {
+    PNG_CLEANUP
+    return 0;
+  }
+
+  /* Treat benign errors as warnings */
+  png_set_benign_errors(png_handler.png_ptr, 1);
+
+  png_set_crc_action(png_handler.png_ptr, PNG_CRC_QUIET_USE, PNG_CRC_QUIET_USE);
+
+#ifdef PNG_IGNORE_ADLER32
+  png_set_option(png_handler.png_ptr, PNG_IGNORE_ADLER32, PNG_OPTION_ON);
+#endif
+
+  // Setting up reading from buffer.
+  png_handler.buf_state = new BufState();
+  png_handler.buf_state->data = data + kPngHeaderSize;
+  png_handler.buf_state->bytes_left = size - kPngHeaderSize;
+  png_set_read_fn(png_handler.png_ptr, png_handler.buf_state, user_read_data);
+  png_set_sig_bytes(png_handler.png_ptr, kPngHeaderSize);
+
+  if (setjmp(png_jmpbuf(png_handler.png_ptr))) {
+    PNG_CLEANUP
+    return 0;
+  }
+
+  // Reading.
+  png_read_info(png_handler.png_ptr, png_handler.info_ptr);
+  png_read_update_info(png_handler.png_ptr, png_handler.info_ptr);
+  png_handler.row_ptr = png_malloc(
+      png_handler.png_ptr, png_get_rowbytes(png_handler.png_ptr,
+                                               png_handler.info_ptr));
+
+  // reset error handler to put png_deleter into scope.
+  if (setjmp(png_jmpbuf(png_handler.png_ptr))) {
+    PNG_CLEANUP
+    return 0;
+  }
+
+  png_uint_32 width, height;
+  int bit_depth, color_type, interlace_type, compression_type;
+  int filter_type;
+
+  if (!png_get_IHDR(png_handler.png_ptr, png_handler.info_ptr, &width,
+                    &height, &bit_depth, &color_type, &interlace_type,
+                    &compression_type, &filter_type)) {
+    PNG_CLEANUP
+    return 0;
+  }
+
+  // This is going to be too slow.
+  if (width && height > 100000000 / width) {
+    PNG_CLEANUP
+    return 0;
+  }
+
+  int passes = png_set_interlace_handling(png_handler.png_ptr);
+  png_start_read_image(png_handler.png_ptr);
+
+  /* To do: prevent the optimizer from removing this code entirely */
+  for (int pass = 0; pass < passes; ++pass) {
+    for (png_uint_32 y = 0; y < height; ++y) {
+      png_read_row(png_handler.png_ptr,
+                   static_cast<png_bytep>(png_handler.row_ptr), nullptr);
+    }
+  }
+
+  png_read_end(png_handler.png_ptr, png_handler.end_info_ptr);
+
+  PNG_CLEANUP
+
+  /* TO do: exercise the progressive reader here */
+
+  return 0;
+}

Added: branches/stable/source/src/libs/libpng/libpng-src/contrib/oss-fuzz/png.dict
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/contrib/oss-fuzz/png.dict	                        (rev 0)
+++ branches/stable/source/src/libs/libpng/libpng-src/contrib/oss-fuzz/png.dict	2017-11-01 18:15:56 UTC (rev 780)
@@ -0,0 +1,39 @@
+#
+# AFL dictionary for PNG images
+# -----------------------------
+#
+# Just the basic, standard-originating sections; does not include vendor
+# extensions.
+#
+# Created by Michal Zalewski <lcamtuf at google.com>
+#
+
+header_png="\x89PNG\x0d\x0a\x1a\x0a"
+
+section_IDAT="IDAT"
+section_IEND="IEND"
+section_IHDR="IHDR"
+section_PLTE="PLTE"
+section_bKGD="bKGD"
+section_cHRM="cHRM"
+section_eXIf="eXIf"
+section_fRAc="fRAc"
+section_gAMA="gAMA"
+section_gIFg="gIFg"
+section_gIFt="gIFt"
+section_gIFx="gIFx"
+section_hIST="hIST"
+section_iCCP="iCCP"
+section_iTXt="iTXt"
+section_oFFs="oFFs"
+section_pCAL="pCAL"
+section_pHYs="pHYs"
+section_sBIT="sBIT"
+section_sCAL="sCAL"
+section_sPLT="sPLT"
+section_sRGB="sRGB"
+section_sTER="sTER"
+section_tEXt="tEXt"
+section_tIME="tIME"
+section_tRNS="tRNS"
+section_zTXt="zTXt"

Modified: branches/stable/source/src/libs/libpng/libpng-src/contrib/pngminus/png2pnm.c
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/contrib/pngminus/png2pnm.c	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/contrib/pngminus/png2pnm.c	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,8 +1,12 @@
 /*
  *  png2pnm.c --- conversion from PNG-file to PGM/PPM-file
- *  copyright (C) 1999 by Willem van Schaik <willem at schaik.com>
+ *  copyright (C) 1999,2017 by Willem van Schaik <willem at schaik.com>
  *
  *  version 1.0 - 1999.10.15 - First version.
+ *          1.1 - 2017.04.22 - Add buffer-size check (Glenn Randers-Pehrson)
+ *          1.2 - 2017.08.24 - Fix potential overflow in buffer-size check
+ *                             (Glenn Randers-Pehrson)
+ *          1.3 - 2017.08.28 - Add PNGMINUS_UNUSED (Christian Hesse)
  *
  *  Permission to use, copy, modify, and distribute this software and
  *  its documentation for any purpose and without fee is hereby granted,
@@ -41,6 +45,7 @@
 #define PNG_DEBUG 0
 #endif
 
+
 #include "png.h"
 
 /* Define png_jmpbuf() in case we are using a pre-1.0.6 version of libpng */
@@ -48,6 +53,14 @@
 #  define png_jmpbuf(png_ptr) ((png_ptr)->jmpbuf)
 #endif
 
+#ifndef PNGMINUS_UNUSED
+/* Unused formal parameter warnings are silenced using the following macro
+ * which is expected to have no bad effects on performance (optimizing
+ * compilers will probably remove it entirely).
+ */
+#  define PNGMINUS_UNUSED(param) (void)param
+#endif
+
 /* function prototypes */
 
 int  main (int argc, char *argv[]);
@@ -320,14 +333,21 @@
   /* row_bytes is the width x number of channels x (bit-depth / 8) */
   row_bytes = png_get_rowbytes (png_ptr, info_ptr);
 
+  if ((row_bytes == 0 || (size_t)height > ((size_t)(-1))/(size_t)row_bytes))
+  {
+    /* too big */ 
+    png_destroy_read_struct (&png_ptr, &info_ptr, NULL);
+    return FALSE;
+  }
   if ((png_pixels = (png_byte *)
-     malloc (row_bytes * height * sizeof (png_byte))) == NULL) {
+     malloc ((size_t)row_bytes * (size_t)height * sizeof (png_byte))) == NULL)
+  {
     png_destroy_read_struct (&png_ptr, &info_ptr, NULL);
     return FALSE;
   }
 
   if ((row_pointers = (png_byte **)
-     malloc (height * sizeof (png_bytep))) == NULL)
+     malloc ((size_t)height * sizeof (png_bytep))) == NULL)
   {
     png_destroy_read_struct (&png_ptr, &info_ptr, NULL);
     free (png_pixels);
@@ -408,7 +428,8 @@
           if (raw)
             fputc ((int) *pix_ptr++ , alpha_file);
           else
-            if (bit_depth == 16){
+            if (bit_depth == 16)
+            {
               dep_16 = (long) *pix_ptr++;
               fprintf (alpha_file, "%ld ", (dep_16 << 8) + (long) *pix_ptr++);
             }
@@ -432,6 +453,7 @@
   if (png_pixels != (unsigned char*) NULL)
     free (png_pixels);
 
+  PNGMINUS_UNUSED(raw); /* to quiet a Coverity defect */
   return TRUE;
 
 } /* end of source */

Modified: branches/stable/source/src/libs/libpng/libpng-src/contrib/pngminus/pnm2png.c
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/contrib/pngminus/pnm2png.c	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/contrib/pngminus/pnm2png.c	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,9 +1,13 @@
 /*
  *  pnm2png.c --- conversion from PBM/PGM/PPM-file to PNG-file
- *  copyright (C) 1999 by Willem van Schaik <willem at schaik.com>
+ *  copyright (C) 1999,2015,2017 by Willem van Schaik <willem at schaik.com>
  *
  *  version 1.0 - 1999.10.15 - First version.
  *  version 1.1 - 2015.07.29 - Fixed leaks (Glenn Randers-Pehrson)
+ *  version 1.2 - 2017.04.22 - Add buffer-size check
+ *          1.3 - 2017.08.24 - Fix potential overflow in buffer-size check
+ *                             (Glenn Randers-Pehrson)
+ *          1.4 - 2017.08.28 - Add PNGMINUS_UNUSED (Christian Hesse)
  *
  *  Permission to use, copy, modify, and distribute this software and
  *  its documentation for any purpose and without fee is hereby granted,
@@ -47,6 +51,15 @@
 #  define png_jmpbuf(png_ptr) ((png_ptr)->jmpbuf)
 #endif
 
+#ifndef PNGMINUS_UNUSED
+/* Unused formal parameter warnings are silenced using the following macro
+ * which is expected to have no bad effects on performance (optimizing
+ * compilers will probably remove it entirely).
+ */
+#  define PNGMINUS_UNUSED(param) (void)param
+#endif
+
+
 /* function prototypes */
 
 int  main (int argc, char *argv[]);
@@ -370,11 +383,16 @@
     row_bytes = (width * channels * bit_depth + 7) / 8;
   else
 #endif
-    /* row_bytes is the width x number of channels x (bit-depth / 8) */
+  /* row_bytes is the width x number of channels x (bit-depth / 8) */
     row_bytes = width * channels * ((bit_depth <= 8) ? 1 : 2);
 
+  if ((row_bytes == 0 || (size_t)height > ((size_t)(-1))/(size_t)row_bytes))
+  {
+    /* too big */ 
+    return FALSE;
+  }
   if ((png_pixels = (png_byte *)
-     malloc (row_bytes * height * sizeof (png_byte))) == NULL)
+     malloc ((size_t)row_bytes * (size_t)height * sizeof (png_byte))) == NULL)
     return FALSE;
 
   /* read data from PNM file */
@@ -383,7 +401,8 @@
   for (row = 0; row < (int) height; row++)
   {
 #if defined(PNG_WRITE_INVERT_SUPPORTED) || defined(PNG_WRITE_PACK_SUPPORTED)
-    if (packed_bitmap) {
+    if (packed_bitmap)
+    {
       for (i = 0; i < (int) row_bytes; i++)
         /* png supports this format natively so no conversion is needed */
         *pix_ptr++ = get_data (pnm_file, 8);
@@ -504,6 +523,8 @@
   if (png_pixels != (unsigned char*) NULL)
     free (png_pixels);
 
+  PNGMINUS_UNUSED(raw); /* Quiet a Coverity defect */
+
   return TRUE;
 } /* end of pnm2png */
 
@@ -520,7 +541,8 @@
   do
   {
     ret = fgetc(pnm_file);
-    if (ret == '#') {
+    if (ret == '#')
+    {
       /* the rest of this line is a comment */
       do
       {

Added: branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/bad_iCCP.png
===================================================================
(Binary files differ)

Index: branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/bad_iCCP.png
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/bad_iCCP.png	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/bad_iCCP.png	2017-11-01 18:15:56 UTC (rev 780)

Property changes on: branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/bad_iCCP.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+image/png
\ No newline at end of property
Added: branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/badadler.png
===================================================================
(Binary files differ)

Index: branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/badadler.png
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/badadler.png	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/badadler.png	2017-11-01 18:15:56 UTC (rev 780)

Property changes on: branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/badadler.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+image/png
\ No newline at end of property
Added: branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/badcrc.png
===================================================================
(Binary files differ)

Index: branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/badcrc.png
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/badcrc.png	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/badcrc.png	2017-11-01 18:15:56 UTC (rev 780)

Property changes on: branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/badcrc.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+image/png
\ No newline at end of property
Added: branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/empty_ancillary_chunks.png
===================================================================
(Binary files differ)

Index: branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/empty_ancillary_chunks.png
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/empty_ancillary_chunks.png	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/empty_ancillary_chunks.png	2017-11-01 18:15:56 UTC (rev 780)

Property changes on: branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/empty_ancillary_chunks.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+image/png
\ No newline at end of property
Added: branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_IDAT.png
===================================================================
(Binary files differ)

Index: branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_IDAT.png
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_IDAT.png	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_IDAT.png	2017-11-01 18:15:56 UTC (rev 780)

Property changes on: branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_IDAT.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+image/png
\ No newline at end of property
Added: branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_bKGD_chunk.png
===================================================================
(Binary files differ)

Index: branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_bKGD_chunk.png
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_bKGD_chunk.png	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_bKGD_chunk.png	2017-11-01 18:15:56 UTC (rev 780)

Property changes on: branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_bKGD_chunk.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+image/png
\ No newline at end of property
Added: branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_cHRM_chunk.png
===================================================================
(Binary files differ)

Index: branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_cHRM_chunk.png
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_cHRM_chunk.png	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_cHRM_chunk.png	2017-11-01 18:15:56 UTC (rev 780)

Property changes on: branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_cHRM_chunk.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+image/png
\ No newline at end of property
Added: branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_eXIf_chunk.png
===================================================================
(Binary files differ)

Index: branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_eXIf_chunk.png
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_eXIf_chunk.png	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_eXIf_chunk.png	2017-11-01 18:15:56 UTC (rev 780)

Property changes on: branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_eXIf_chunk.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+image/png
\ No newline at end of property
Added: branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_gAMA_chunk.png
===================================================================
(Binary files differ)

Index: branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_gAMA_chunk.png
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_gAMA_chunk.png	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_gAMA_chunk.png	2017-11-01 18:15:56 UTC (rev 780)

Property changes on: branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_gAMA_chunk.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+image/png
\ No newline at end of property
Added: branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_hIST_chunk.png
===================================================================
(Binary files differ)

Index: branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_hIST_chunk.png
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_hIST_chunk.png	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_hIST_chunk.png	2017-11-01 18:15:56 UTC (rev 780)

Property changes on: branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_hIST_chunk.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+image/png
\ No newline at end of property
Added: branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_iCCP_chunk.png
===================================================================
(Binary files differ)

Index: branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_iCCP_chunk.png
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_iCCP_chunk.png	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_iCCP_chunk.png	2017-11-01 18:15:56 UTC (rev 780)

Property changes on: branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_iCCP_chunk.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+image/png
\ No newline at end of property
Added: branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_iTXt_chunk.png
===================================================================
(Binary files differ)

Index: branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_iTXt_chunk.png
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_iTXt_chunk.png	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_iTXt_chunk.png	2017-11-01 18:15:56 UTC (rev 780)

Property changes on: branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_iTXt_chunk.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+image/png
\ No newline at end of property
Added: branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_juNK_unsafe_to_copy.png
===================================================================
(Binary files differ)

Index: branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_juNK_unsafe_to_copy.png
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_juNK_unsafe_to_copy.png	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_juNK_unsafe_to_copy.png	2017-11-01 18:15:56 UTC (rev 780)

Property changes on: branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_juNK_unsafe_to_copy.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+image/png
\ No newline at end of property
Added: branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_juNk_safe_to_copy.png
===================================================================
(Binary files differ)

Index: branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_juNk_safe_to_copy.png
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_juNk_safe_to_copy.png	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_juNk_safe_to_copy.png	2017-11-01 18:15:56 UTC (rev 780)

Property changes on: branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_juNk_safe_to_copy.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+image/png
\ No newline at end of property
Added: branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_pCAL_chunk.png
===================================================================
(Binary files differ)

Index: branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_pCAL_chunk.png
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_pCAL_chunk.png	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_pCAL_chunk.png	2017-11-01 18:15:56 UTC (rev 780)

Property changes on: branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_pCAL_chunk.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+image/png
\ No newline at end of property
Added: branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_pHYs_chunk.png
===================================================================
(Binary files differ)

Index: branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_pHYs_chunk.png
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_pHYs_chunk.png	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_pHYs_chunk.png	2017-11-01 18:15:56 UTC (rev 780)

Property changes on: branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_pHYs_chunk.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+image/png
\ No newline at end of property
Added: branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_sCAL_chunk.png
===================================================================
(Binary files differ)

Index: branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_sCAL_chunk.png
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_sCAL_chunk.png	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_sCAL_chunk.png	2017-11-01 18:15:56 UTC (rev 780)

Property changes on: branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_sCAL_chunk.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+image/png
\ No newline at end of property
Added: branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_sPLT_chunk.png
===================================================================
(Binary files differ)

Index: branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_sPLT_chunk.png
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_sPLT_chunk.png	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_sPLT_chunk.png	2017-11-01 18:15:56 UTC (rev 780)

Property changes on: branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_sPLT_chunk.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+image/png
\ No newline at end of property
Added: branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_sRGB_chunk.png
===================================================================
(Binary files differ)

Index: branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_sRGB_chunk.png
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_sRGB_chunk.png	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_sRGB_chunk.png	2017-11-01 18:15:56 UTC (rev 780)

Property changes on: branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_sRGB_chunk.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+image/png
\ No newline at end of property
Added: branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_sTER_chunk.png
===================================================================
(Binary files differ)

Index: branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_sTER_chunk.png
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_sTER_chunk.png	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_sTER_chunk.png	2017-11-01 18:15:56 UTC (rev 780)

Property changes on: branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_sTER_chunk.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+image/png
\ No newline at end of property
Added: branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_tEXt_chunk.png
===================================================================
(Binary files differ)

Index: branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_tEXt_chunk.png
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_tEXt_chunk.png	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_tEXt_chunk.png	2017-11-01 18:15:56 UTC (rev 780)

Property changes on: branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_tEXt_chunk.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+image/png
\ No newline at end of property
Added: branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_tIME_chunk.png
===================================================================
(Binary files differ)

Index: branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_tIME_chunk.png
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_tIME_chunk.png	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_tIME_chunk.png	2017-11-01 18:15:56 UTC (rev 780)

Property changes on: branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_tIME_chunk.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+image/png
\ No newline at end of property
Added: branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_zTXt_chunk.png
===================================================================
(Binary files differ)

Index: branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_zTXt_chunk.png
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_zTXt_chunk.png	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_zTXt_chunk.png	2017-11-01 18:15:56 UTC (rev 780)

Property changes on: branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/crashers/huge_zTXt_chunk.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+image/png
\ No newline at end of property
Modified: branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/makepngs.sh
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/makepngs.sh	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/contrib/testpngs/makepngs.sh	2017-11-01 18:15:56 UTC (rev 780)
@@ -5,7 +5,7 @@
 
 # Copyright (c) 2015 John Cunningham Bowler
 
-# Last changed in libpng 1.7.0 [(PENDING RELEASE)]
+# Last changed in libpng 1.6.20 [December 3, 2015]
 
 # This code is released under the libpng license.
 # For conditions of distribution and use, see the disclaimer

Modified: branches/stable/source/src/libs/libpng/libpng-src/contrib/tools/genpng.c
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/contrib/tools/genpng.c	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/contrib/tools/genpng.c	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,7 +1,8 @@
 /*- genpng
  *
  * COPYRIGHT: Written by John Cunningham Bowler, 2015.
- * To the extent possible under law, the author has waived all copyright and
+ * Revised by Glenn Randers-Pehrson, 2017, to add buffer-size check.
+ * To the extent possible under law, the authors have waived all copyright and
  * related or neighboring rights to this work.  This work is published from:
  * United States.
  *
@@ -783,6 +784,19 @@
          return 1;
       }
 
+#if 1
+     /* TO do: determine whether this guard against overflow is necessary.
+      * This comment in png.h indicates that it should be safe: "libpng will
+      * refuse to process an image where such an overflow would occur", but
+      * I don't see where the image gets rejected when the buffer is too
+      * large before the malloc is attempted.
+      */
+      if (image.height > ((size_t)(-1))/(8*image.width)) {
+         fprintf(stderr, "genpng: image buffer would be too big");
+         return 1;
+      }
+#endif
+
       /* Create the buffer: */
       buffer = malloc(PNG_IMAGE_SIZE(image));
 

Modified: branches/stable/source/src/libs/libpng/libpng-src/contrib/tools/pngfix.c
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/contrib/tools/pngfix.c	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/contrib/tools/pngfix.c	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,9 +1,8 @@
 /* pngfix.c
  *
- * Copyright (c) 2014-2016 John Cunningham Bowler
+ * Last changed in libpng 1.6.31 [July 27, 2017]
+ * Copyright (c) 2014-2017 John Cunningham Bowler
  *
- * Last changed in libpng 1.6.26 [October 20, 2016]
- *
  * This code is released under the libpng license.
  * For conditions of distribution and use, see the disclaimer
  * and license in png.h
@@ -2416,7 +2415,7 @@
                   endrc = ZLIB_TOO_FAR_BACK;
                   break;
                }
-               /* FALL THROUGH */
+               /* FALLTHROUGH */
 
             default:
                zlib_message(zlib, 0/*stream error*/);
@@ -2570,7 +2569,7 @@
                   list->lengths[i] -= zlib->extra_bytes;
                   list->count = i+1;
                   zlib->idat->idat_list_tail = list;
-                  /* FALL THROUGH */
+                  /* FALLTHROUGH */
 
                default:
                   return rc;
@@ -2673,7 +2672,7 @@
             /* Truncated stream; unrecoverable, gets converted to ZLIB_FATAL */
             zlib.z.msg = PNGZ_MSG_CAST("[truncated]");
             zlib_message(&zlib, 0/*expected*/);
-            /* FALL THROUGH */
+            /* FALLTHROUGH */
 
          default:
             /* Unrecoverable error; skip the chunk; a zlib_message has already
@@ -3341,7 +3340,7 @@
                if (file->state != STATE_IDAT && length > 0)
                   setpos(chunk);
             }
-            /* FALL THROUGH */
+            /* FALLTHROUGH */
 
          default:
             assert(chunk != NULL);

Modified: branches/stable/source/src/libs/libpng/libpng-src/contrib/tools/sRGB.h
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/contrib/tools/sRGB.h	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/contrib/tools/sRGB.h	2017-11-01 18:15:56 UTC (rev 780)
@@ -14,7 +14,7 @@
  * All routines take and return a floating point value in the range
  * 0 to 1.0, doing a calculation according to the sRGB specification
  * (in fact the source of the numbers is the wikipedia article at
- * http://en.wikipedia.org/wiki/SRGB).
+ * https://en.wikipedia.org/wiki/SRGB).
  */
 static double
 sRGB_from_linear(double l)

Modified: branches/stable/source/src/libs/libpng/libpng-src/contrib/visupng/PngFile.c
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/contrib/visupng/PngFile.c	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/contrib/visupng/PngFile.c	2017-11-01 18:15:56 UTC (rev 780)
@@ -2,7 +2,7 @@
  *  PNGFILE.C -- Image File Functions
  *-------------------------------------
  *
- * Copyright 2000, Willem van Schaik.
+ * Copyright 2000,2017 Willem van Schaik.
  *
  * This code is released under the libpng license.
  * For conditions of distribution and use, see the disclaimer
@@ -236,6 +236,10 @@
             free (pbImageData);
             pbImageData = NULL;
         }
+        if ((*piHeight) > ((size_t)(-1))/ulRowBytes) {
+        {
+            png_error(png_ptr, "Visual PNG: image is too big");
+        }
         if ((pbImageData = (png_byte *) malloc(ulRowBytes * (*piHeight)
                             * sizeof(png_byte))) == NULL)
         {

Modified: branches/stable/source/src/libs/libpng/libpng-src/contrib/visupng/VisualPng.c
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/contrib/visupng/VisualPng.c	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/contrib/visupng/VisualPng.c	2017-11-01 18:15:56 UTC (rev 780)
@@ -2,7 +2,7 @@
  *  VisualPng.C -- Shows a PNG image
  *------------------------------------
  *
- * Copyright 2000, Willem van Schaik.
+ * Copyright 2000,2017 Willem van Schaik.
  *
  * This code is released under the libpng license.
  * For conditions of distribution and use, see the disclaimer
@@ -726,6 +726,10 @@
         pDib = NULL;
     }
 
+    if (cyWinSize > ((size_t)(-1))/wDIRowBytes) {
+    {
+        MessageBox (hwnd, TEXT ("Visual PNG: image is too big");
+    }
     if (!(pDib = (BYTE *) malloc (sizeof(BITMAPINFOHEADER) +
         wDIRowBytes * cyWinSize)))
     {
@@ -847,6 +851,10 @@
             cxImgPos = (cxWinSize - cxNewSize) / 2;
         }
 
+        if (cyNewSize > ((size_t)(-1))/(cImgChannels * cxNewSize)) {
+        {
+            MessageBox (hwnd, TEXT ("Visual PNG: stretched image is too big");
+        }
         pStretchedImage = malloc (cImgChannels * cxNewSize * cyNewSize);
         pImg = pStretchedImage;
 

Modified: branches/stable/source/src/libs/libpng/libpng-src/example.c
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/example.c	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/example.c	2017-11-01 18:15:56 UTC (rev 780)
@@ -114,13 +114,13 @@
 
          else
          {
-            /* Calling png_free_image is optional unless the simplified API was
+            /* Calling png_image_free is optional unless the simplified API was
              * not run to completion.  In this case if there wasn't enough
              * memory for 'buffer' we didn't complete the read, so we must free
              * the image:
              */
             if (buffer == NULL)
-               png_free_image(&image);
+               png_image_free(&image);
 
             else
                free(buffer);
@@ -983,6 +983,11 @@
    png_uint_32 k, height, width;
 
    /* In this example, "image" is a one-dimensional array of bytes */
+
+   /* Guard against integer overflow */
+   if (height > PNG_SIZE_MAX/(width*bytes_per_pixel)) {
+      png_error(png_ptr, "Image_data buffer would be too large");
+   }
    png_byte image[height*width*bytes_per_pixel];
 
    png_bytep row_pointers[height];

Modified: branches/stable/source/src/libs/libpng/libpng-src/intel/filter_sse2_intrinsics.c
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/intel/filter_sse2_intrinsics.c	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/intel/filter_sse2_intrinsics.c	2017-11-01 18:15:56 UTC (rev 780)
@@ -5,7 +5,7 @@
  * Written by Mike Klein and Matt Sarett
  * Derived from arm/filter_neon_intrinsics.c
  *
- * Last changed in libpng 1.6.29 [March 16, 2017]
+ * Last changed in libpng 1.6.31 [July 27, 2017]
  *
  * This code is released under the libpng license.
  * For conditions of distribution and use, see the disclaimer
@@ -40,7 +40,7 @@
    /* We'll load 2 bytes, then 1 byte,
     * then mask them together, and finally load into SSE.
     */
-   const png_uint_16* p01 = p;
+   const png_uint_16* p01 = (png_const_uint_16p)p;
    const png_byte*    p2  = (const png_byte*)(p01+1);
 
    png_uint_32 v012 = (png_uint_32)(*p01)
@@ -53,12 +53,15 @@
     * its bottom two bytes, then its third byte.
     */
    png_uint_32 v012;
+   png_uint_16* p01;
+   png_byte*    p2;
+
    store4(&v012, v);
 
-   png_uint_16* p01 = p;
-   png_byte*    p2  = (png_byte*)(p01+1);
-   *p01 = v012;
-   *p2  = v012 >> 16;
+   p01 = (png_uint_16p)p;
+   p2  = (png_byte*)(p01+1);
+   *p01 = (png_uint_16)v012;
+   *p2  = (png_byte)(v012 >> 16);
 }
 
 void png_read_filter_row_sub3_sse2(png_row_infop row_info, png_bytep row,
@@ -68,10 +71,13 @@
     * There is no pixel to the left of the first pixel.  It's encoded directly.
     * That works with our main loop if we just say that left pixel was zero.
     */
-   png_debug(1, "in png_read_filter_row_sub3_sse2");
+   png_size_t rb;
+
    __m128i a, d = _mm_setzero_si128();
 
-   int rb = row_info->rowbytes;
+   png_debug(1, "in png_read_filter_row_sub3_sse2");
+
+   rb = row_info->rowbytes;
    while (rb >= 4) {
       a = d; d = load4(row);
       d = _mm_add_epi8(d, a);
@@ -88,6 +94,7 @@
       row += 3;
       rb  -= 3;
    }
+   PNG_UNUSED(prev)
 }
 
 void png_read_filter_row_sub4_sse2(png_row_infop row_info, png_bytep row,
@@ -97,11 +104,14 @@
     * There is no pixel to the left of the first pixel.  It's encoded directly.
     * That works with our main loop if we just say that left pixel was zero.
     */
-   png_debug(1, "in png_read_filter_row_sub4_sse2");
+   png_size_t rb;
+
    __m128i a, d = _mm_setzero_si128();
 
-   int rb = row_info->rowbytes;
-   while (rb > 0) {
+   png_debug(1, "in png_read_filter_row_sub4_sse2");
+
+   rb = row_info->rowbytes+4;
+   while (rb > 4) {
       a = d; d = load4(row);
       d = _mm_add_epi8(d, a);
       store4(row, d);
@@ -109,6 +119,7 @@
       row += 4;
       rb  -= 4;
    }
+   PNG_UNUSED(prev)
 }
 
 void png_read_filter_row_avg3_sse2(png_row_infop row_info, png_bytep row,
@@ -119,18 +130,23 @@
     * predicted to be half of the pixel above it.  So again, this works
     * perfectly with our loop if we make sure a starts at zero.
     */
-   png_debug(1, "in png_read_filter_row_avg3_sse2");
+
+   png_size_t rb;
+
    const __m128i zero = _mm_setzero_si128();
+
    __m128i    b;
    __m128i a, d = zero;
 
-   int rb = row_info->rowbytes;
+   png_debug(1, "in png_read_filter_row_avg3_sse2");
+   rb = row_info->rowbytes;
    while (rb >= 4) {
+      __m128i avg;
              b = load4(prev);
       a = d; d = load4(row );
 
       /* PNG requires a truncating average, so we can't just use _mm_avg_epu8 */
-      __m128i avg = _mm_avg_epu8(a,b);
+      avg = _mm_avg_epu8(a,b);
       /* ...but we can fix it up by subtracting off 1 if it rounded up. */
       avg = _mm_sub_epi8(avg, _mm_and_si128(_mm_xor_si128(a,b),
                                             _mm_set1_epi8(1)));
@@ -142,11 +158,12 @@
       rb   -= 3;
    }
    if (rb > 0) {
+      __m128i avg;
              b = load3(prev);
       a = d; d = load3(row );
 
       /* PNG requires a truncating average, so we can't just use _mm_avg_epu8 */
-      __m128i avg = _mm_avg_epu8(a,b);
+      avg = _mm_avg_epu8(a,b);
       /* ...but we can fix it up by subtracting off 1 if it rounded up. */
       avg = _mm_sub_epi8(avg, _mm_and_si128(_mm_xor_si128(a,b),
                                             _mm_set1_epi8(1)));
@@ -168,18 +185,21 @@
     * predicted to be half of the pixel above it.  So again, this works
     * perfectly with our loop if we make sure a starts at zero.
     */
-   png_debug(1, "in png_read_filter_row_avg4_sse2");
+   png_size_t rb;
    const __m128i zero = _mm_setzero_si128();
    __m128i    b;
    __m128i a, d = zero;
 
-   int rb = row_info->rowbytes;
-   while (rb > 0) {
+   png_debug(1, "in png_read_filter_row_avg4_sse2");
+
+   rb = row_info->rowbytes+4;
+   while (rb > 4) {
+      __m128i avg;
              b = load4(prev);
       a = d; d = load4(row );
 
       /* PNG requires a truncating average, so we can't just use _mm_avg_epu8 */
-      __m128i avg = _mm_avg_epu8(a,b);
+      avg = _mm_avg_epu8(a,b);
       /* ...but we can fix it up by subtracting off 1 if it rounded up. */
       avg = _mm_sub_epi8(avg, _mm_and_si128(_mm_xor_si128(a,b),
                                             _mm_set1_epi8(1)));
@@ -237,38 +257,42 @@
     * Here we zero b and d, which become c and a respectively at the start of
     * the loop.
     */
-   png_debug(1, "in png_read_filter_row_paeth3_sse2");
+   png_size_t rb;
    const __m128i zero = _mm_setzero_si128();
    __m128i c, b = zero,
            a, d = zero;
 
-   int rb = row_info->rowbytes;
+   png_debug(1, "in png_read_filter_row_paeth3_sse2");
+
+   rb = row_info->rowbytes;
    while (rb >= 4) {
       /* It's easiest to do this math (particularly, deal with pc) with 16-bit
        * intermediates.
        */
+      __m128i pa,pb,pc,smallest,nearest;
       c = b; b = _mm_unpacklo_epi8(load4(prev), zero);
       a = d; d = _mm_unpacklo_epi8(load4(row ), zero);
 
       /* (p-a) == (a+b-c - a) == (b-c) */
-      __m128i pa = _mm_sub_epi16(b,c);
+   
+      pa = _mm_sub_epi16(b,c);
 
       /* (p-b) == (a+b-c - b) == (a-c) */
-      __m128i pb = _mm_sub_epi16(a,c);
+      pb = _mm_sub_epi16(a,c);
 
       /* (p-c) == (a+b-c - c) == (a+b-c-c) == (b-c)+(a-c) */
-      __m128i pc = _mm_add_epi16(pa,pb);
+      pc = _mm_add_epi16(pa,pb);
 
       pa = abs_i16(pa);  /* |p-a| */
       pb = abs_i16(pb);  /* |p-b| */
       pc = abs_i16(pc);  /* |p-c| */
 
-      __m128i smallest = _mm_min_epi16(pc, _mm_min_epi16(pa, pb));
+      smallest = _mm_min_epi16(pc, _mm_min_epi16(pa, pb));
 
       /* Paeth breaks ties favoring a over b over c. */
-      __m128i nearest  = if_then_else(_mm_cmpeq_epi16(smallest, pa), a,
-                         if_then_else(_mm_cmpeq_epi16(smallest, pb), b,
-                                                                     c));
+      nearest  = if_then_else(_mm_cmpeq_epi16(smallest, pa), a,
+                 if_then_else(_mm_cmpeq_epi16(smallest, pb), b,
+                                                             c));
 
       /* Note `_epi8`: we need addition to wrap modulo 255. */
       d = _mm_add_epi8(d, nearest);
@@ -282,26 +306,27 @@
       /* It's easiest to do this math (particularly, deal with pc) with 16-bit
        * intermediates.
        */
+      __m128i pa,pb,pc,smallest,nearest;
       c = b; b = _mm_unpacklo_epi8(load3(prev), zero);
       a = d; d = _mm_unpacklo_epi8(load3(row ), zero);
 
       /* (p-a) == (a+b-c - a) == (b-c) */
-      __m128i pa = _mm_sub_epi16(b,c);
+      pa = _mm_sub_epi16(b,c);
 
       /* (p-b) == (a+b-c - b) == (a-c) */
-      __m128i pb = _mm_sub_epi16(a,c);
+      pb = _mm_sub_epi16(a,c);
 
       /* (p-c) == (a+b-c - c) == (a+b-c-c) == (b-c)+(a-c) */
-      __m128i pc = _mm_add_epi16(pa,pb);
+      pc = _mm_add_epi16(pa,pb);
 
       pa = abs_i16(pa);  /* |p-a| */
       pb = abs_i16(pb);  /* |p-b| */
       pc = abs_i16(pc);  /* |p-c| */
 
-      __m128i smallest = _mm_min_epi16(pc, _mm_min_epi16(pa, pb));
+      smallest = _mm_min_epi16(pc, _mm_min_epi16(pa, pb));
 
       /* Paeth breaks ties favoring a over b over c. */
-      __m128i nearest  = if_then_else(_mm_cmpeq_epi16(smallest, pa), a,
+      nearest  = if_then_else(_mm_cmpeq_epi16(smallest, pa), a,
                          if_then_else(_mm_cmpeq_epi16(smallest, pb), b,
                                                                      c));
 
@@ -331,13 +356,16 @@
     * Here we zero b and d, which become c and a respectively at the start of
     * the loop.
     */
-   png_debug(1, "in png_read_filter_row_paeth4_sse2");
+   png_size_t rb;
    const __m128i zero = _mm_setzero_si128();
+   __m128i pa,pb,pc,smallest,nearest;
    __m128i c, b = zero,
            a, d = zero;
 
-   int rb = row_info->rowbytes;
-   while (rb > 0) {
+   png_debug(1, "in png_read_filter_row_paeth4_sse2");
+
+   rb = row_info->rowbytes+4;
+   while (rb > 4) {
       /* It's easiest to do this math (particularly, deal with pc) with 16-bit
        * intermediates.
        */
@@ -345,22 +373,22 @@
       a = d; d = _mm_unpacklo_epi8(load4(row ), zero);
 
       /* (p-a) == (a+b-c - a) == (b-c) */
-      __m128i pa = _mm_sub_epi16(b,c);
+      pa = _mm_sub_epi16(b,c);
 
       /* (p-b) == (a+b-c - b) == (a-c) */
-      __m128i pb = _mm_sub_epi16(a,c);
+      pb = _mm_sub_epi16(a,c);
 
       /* (p-c) == (a+b-c - c) == (a+b-c-c) == (b-c)+(a-c) */
-      __m128i pc = _mm_add_epi16(pa,pb);
+      pc = _mm_add_epi16(pa,pb);
 
       pa = abs_i16(pa);  /* |p-a| */
       pb = abs_i16(pb);  /* |p-b| */
       pc = abs_i16(pc);  /* |p-c| */
 
-      __m128i smallest = _mm_min_epi16(pc, _mm_min_epi16(pa, pb));
+      smallest = _mm_min_epi16(pc, _mm_min_epi16(pa, pb));
 
       /* Paeth breaks ties favoring a over b over c. */
-      __m128i nearest  = if_then_else(_mm_cmpeq_epi16(smallest, pa), a,
+      nearest  = if_then_else(_mm_cmpeq_epi16(smallest, pa), a,
                          if_then_else(_mm_cmpeq_epi16(smallest, pb), b,
                                                                      c));
 

Modified: branches/stable/source/src/libs/libpng/libpng-src/libpng-manual.txt
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/libpng-manual.txt	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/libpng-manual.txt	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,9 +1,9 @@
 libpng-manual.txt - A description on how to use and modify libpng
 
- libpng version 1.6.29 - March 16, 2017
+ libpng version 1.6.34 - September 29, 2017
  Updated and distributed by Glenn Randers-Pehrson
  <glennrp at users.sourceforge.net>
- Copyright (c) 1998-2016 Glenn Randers-Pehrson
+ Copyright (c) 1998-2017 Glenn Randers-Pehrson
 
  This document is released under the libpng license.
  For conditions of distribution and use, see the disclaimer
@@ -11,9 +11,9 @@
 
  Based on:
 
- libpng versions 0.97, January 1998, through 1.6.29 - March 16, 2017
+ libpng versions 0.97, January 1998, through 1.6.34 - September 29, 2017
  Updated and distributed by Glenn Randers-Pehrson
- Copyright (c) 1998-2016 Glenn Randers-Pehrson
+ Copyright (c) 1998-2017 Glenn Randers-Pehrson
 
  libpng 1.0 beta 6 - version 0.96 - May 28, 1997
  Updated and distributed by Andreas Dilger
@@ -66,17 +66,17 @@
 
 The PNG specification (second edition), November 2003, is available as
 a W3C Recommendation and as an ISO Standard (ISO/IEC 15948:2004 (E)) at
-<http://www.w3.org/TR/2003/REC-PNG-20031110/
+<https://www.w3.org/TR/2003/REC-PNG-20031110/
 The W3C and ISO documents have identical technical content.
 
 The PNG-1.2 specification is available at
-<http://png-mng.sourceforge.net/pub/png/spec/1.2/>.
+<https://png-mng.sourceforge.io/pub/png/spec/1.2/>.
 It is technically equivalent
 to the PNG specification (second edition) but has some additional material.
 
-The PNG-1.0 specification is available as RFC 2083 
-<http://png-mng.sourceforge.net/pub/png/spec/1.0/> and as a
-W3C Recommendation <http://www.w3.org/TR/REC-png-961001>.
+The PNG-1.0 specification is available as RFC 2083
+<https://png-mng.sourceforge.io/pub/png/spec/1.0/> and as a
+W3C Recommendation <https://www.w3.org/TR/REC-png-961001>.
 
 Some additional chunks are described in the special-purpose public chunks
 documents at <http://www.libpng.org/pub/png/spec/register/>
@@ -101,7 +101,7 @@
 
 Libpng uses zlib for its compression and decompression of PNG files.
 Further information about zlib, and the latest version of zlib, can
-be found at the zlib home page, <http://zlib.net/>.
+be found at the zlib home page, <https://zlib.net/>.
 The zlib compression utility is a general purpose utility that is
 useful for more than PNG files, and can be used without libpng.
 See the documentation delivered with zlib for more details.
@@ -688,8 +688,9 @@
    chunk_cache_max = png_get_chunk_cache_max(png_ptr);
 
 Libpng imposes a limit of 8 Megabytes (8,000,000 bytes) on the amount of
-memory that a compressed chunk other than IDAT can occupy, when decompressed.
-You can change this limit with
+memory that any chunk other than IDAT can occupy, originally or when
+decompressed (prior to libpng-1.6.32 the limit was only applied to compressed
+chunks after decompression). You can change this limit with
 
    png_set_chunk_malloc_max(png_ptr, user_chunk_malloc_max);
 
@@ -985,8 +986,17 @@
 
     png_set_alpha_mode(pp, PNG_ALPHA_PNG, PNG_DEFAULT_sRGB);
 
-This is the default libpng handling of the alpha channel - it is not
-pre-multiplied into the color components.  In addition the call states
+Choices for the alpha_mode are
+
+    PNG_ALPHA_PNG           0 /* according to the PNG standard */
+    PNG_ALPHA_STANDARD      1 /* according to Porter/Duff */
+    PNG_ALPHA_ASSOCIATED    1 /* as above; this is the normal practice */
+    PNG_ALPHA_PREMULTIPLIED 1 /* as above */
+    PNG_ALPHA_OPTIMIZED     2 /* 'PNG' for opaque pixels, else 'STANDARD' */
+    PNG_ALPHA_BROKEN        3 /* the alpha channel is gamma encoded */
+
+PNG_ALPHA_PNG is the default libpng handling of the alpha channel. It is not
+pre-multiplied into the color components. In addition the call states
 that the output is for a sRGB system and causes all PNG files without gAMA
 chunks to be assumed to be encoded using sRGB.
 
@@ -1001,7 +1011,7 @@
 This is the classic Jim Blinn approach and will work in academic
 environments where everything is done by the book.  It has the shortcoming
 of assuming that input PNG data with no gamma information is linear - this
-is unlikely to be correct unless the PNG files where generated locally.
+is unlikely to be correct unless the PNG files were generated locally.
 Most of the time the output precision will be so low as to show
 significant banding in dark areas of the image.
 
@@ -1190,8 +1200,21 @@
    png_set_rows(png_ptr, info_ptr, &row_pointers);
 
 Alternatively you could allocate your image in one big block and define
-row_pointers[i] to point into the proper places in your block.
+row_pointers[i] to point into the proper places in your block, but first
+be sure that your platform is able to allocate such a large buffer:
 
+   /* Guard against integer overflow */
+   if (height > PNG_SIZE_MAX/(width*pixel_size)) {
+        png_error(png_ptr,"image_data buffer would be too large");
+   }
+
+   png_bytep buffer=png_malloc(png_ptr,height*width*pixel_size);
+
+   for (int i=0; i<height, i++)
+      row_pointers[i]=buffer+i*width*pixel_size;
+
+   png_set_rows(png_ptr, info_ptr, &row_pointers);
+
 If you use png_set_rows(), the application is responsible for freeing
 row_pointers (and row_pointers[i], if they were separately allocated).
 
@@ -1317,6 +1340,11 @@
     rowbytes = png_get_rowbytes(png_ptr, info_ptr);
 
     rowbytes       - number of bytes needed to hold a row
+                     This value, the bit_depth, color_type,
+                     and the number of channels can change
+                     if you use transforms such as
+                     png_set_expand(). See
+                     png_read_update_info(), below.
 
     signature = png_get_signature(png_ptr, info_ptr);
 
@@ -1435,6 +1463,11 @@
                      the single transparent color for
                      non-paletted images (PNG_INFO_tRNS)
 
+    png_get_eXIf_1(png_ptr, info_ptr, &num_exif, &exif);
+                     (PNG_INFO_eXIf)
+
+    exif           - Exif profile (array of png_byte)
+
     png_get_hIST(png_ptr, info_ptr, &hist);
                      (PNG_INFO_hIST)
 
@@ -2146,6 +2179,16 @@
 array of pointers to each row, as it will be needed for some
 of the functions below.
 
+Be sure that your platform can allocate the buffer that you'll need.
+libpng internally checks for oversize width, but you'll need to
+do your own check for number_of_rows*width*pixel_size if you are using
+a multiple-row buffer:
+
+   /* Guard against integer overflow */
+   if (number_of_rows > PNG_SIZE_MAX/(width*pixel_size)) {
+        png_error(png_ptr,"image_data buffer would be too large");
+   }
+
 Remember: Before you call png_read_update_info(), the png_get_*()
 functions return the values corresponding to the original PNG image.
 After you call png_read_update_info the values refer to the image
@@ -2470,6 +2513,7 @@
              PNG_INFO_gAMA, PNG_INFO_sBIT,
              PNG_INFO_cHRM, PNG_INFO_PLTE,
              PNG_INFO_tRNS, PNG_INFO_bKGD,
+             PNG_INFO_eXIf,
              PNG_INFO_hIST, PNG_INFO_pHYs,
              PNG_INFO_oFFs, PNG_INFO_tIME,
              PNG_INFO_pCAL, PNG_INFO_sRGB,
@@ -3069,6 +3113,11 @@
                      single transparent color for
                      non-paletted images (PNG_INFO_tRNS)
 
+    png_set_eXIf_1(png_ptr, info_ptr, num_exif, exif);
+
+    exif           - Exif profile (array of
+                     png_byte) (PNG_INFO_eXIf)
+
     png_set_hIST(png_ptr, info_ptr, hist);
 
     hist           - histogram of palette (array of
@@ -3824,7 +3873,7 @@
 
 When the simplified API needs to convert between sRGB and linear colorspaces,
 the actual sRGB transfer curve defined in the sRGB specification (see the
-article at http://en.wikipedia.org/wiki/SRGB) is used, not the gamma=1/2.2
+article at https://en.wikipedia.org/wiki/SRGB) is used, not the gamma=1/2.2
 approximation used elsewhere in libpng.
 
 When an alpha channel is present it is expected to denote pixel coverage
@@ -4088,7 +4137,7 @@
 
 When the simplified API needs to convert between sRGB and linear colorspaces,
 the actual sRGB transfer curve defined in the sRGB specification (see the
-article at http://en.wikipedia.org/wiki/SRGB) is used, not the gamma=1/2.2
+article at https://en.wikipedia.org/wiki/SRGB) is used, not the gamma=1/2.2
 approximation used elsewhere in libpng.
 
 WRITE APIS
@@ -4246,8 +4295,6 @@
         png_voidp error_ptr, png_error_ptr error_fn,
         png_error_ptr warning_fn);
 
-    png_voidp error_ptr = png_get_error_ptr(png_ptr);
-
 If NULL is supplied for either error_fn or warning_fn, then the libpng
 default function will be used, calling fprintf() and/or longjmp() if a
 problem is encountered.  The replacement error functions should have
@@ -4259,6 +4306,11 @@
     void user_warning_fn(png_structp png_ptr,
         png_const_charp warning_msg);
 
+Then, within your user_error_fn or user_warning_fn, you can retrieve
+the error_ptr if you need it, by calling
+
+    png_voidp error_ptr = png_get_error_ptr(png_ptr);
+
 The motivation behind using setjmp() and longjmp() is the C++ throw and
 catch exception handling methods.  This makes the code much easier to write,
 as there is no need to check every return code of every function call.
@@ -4266,7 +4318,7 @@
 after a longjmp, so the user may want to be careful about doing anything
 after setjmp returns non-zero besides returning itself.  Consult your
 compiler documentation for more details.  For an alternative approach, you
-may wish to use the "cexcept" facility (see http://cexcept.sourceforge.net),
+may wish to use the "cexcept" facility (see https://cexcept.sourceforge.io/),
 which is illustrated in pngvalid.c and in contrib/visupng.
 
 Beginning in libpng-1.4.0, the png_set_benign_errors() API became available.
@@ -4494,7 +4546,7 @@
 and the MHDR and MEND chunks.  Libpng does not provide support for these
 or any other MNG chunks; your application must provide its own support for
 them.  You may wish to consider using libmng (available at
-http://www.libmng.com) instead.
+https://www.libmng.com/) instead.
 
 VIII.  Changes to Libpng from version 0.88
 
@@ -4917,18 +4969,14 @@
 that it could be used to override them.  Now this function will reduce or
 increase the limits.
 
-Starting in libpng-1.5.10, the user limits can be set en masse with the
-configuration option PNG_SAFE_LIMITS_SUPPORTED.  If this option is enabled,
-a set of "safe" limits is applied in pngpriv.h.  These can be overridden by
-application calls to png_set_user_limits(), png_set_user_chunk_cache_max(),
-and/or png_set_user_malloc_max() that increase or decrease the limits.  Also,
-in libpng-1.5.10 the default width and height limits were increased
-from 1,000,000 to 0x7fffffff (i.e., made unlimited).  Therefore, the
-limits are now
-                               default      safe
+Starting in libpng-1.5.22, default user limits were established. These
+can be overridden by application calls to png_set_user_limits(),
+png_set_user_chunk_cache_max(), and/or png_set_user_malloc_max().
+The limits are now
+                             max possible  default
    png_user_width_max        0x7fffffff    1,000,000
    png_user_height_max       0x7fffffff    1,000,000
-   png_user_chunk_cache_max  0 (unlimited)   128
+   png_user_chunk_cache_max  0 (unlimited) 1000
    png_user_chunk_malloc_max 0 (unlimited) 8,000,000
 
 The png_set_option() function (and the "options" member of the png struct) was
@@ -5178,6 +5226,11 @@
 enforced, and the palette was always limited to 256 entries. An over-length
 PLTE chunk found in an input PNG is silently truncated.
 
+Starting with libpng-1.6.31, the eXIf chunk is supported. Libpng does not
+attempt to decode the Exif profile; it simply returns a byte array
+containing the profile to the calling application which must do its own
+decoding.
+
 XIII.  Detecting libpng
 
 The png_get_io_ptr() function has been present since libpng-0.88, has never
@@ -5194,27 +5247,33 @@
 going back to version 0.70.  You can access the git repository (read only)
 at
 
-    git://git.code.sf.net/p/libpng/code
+    https://github.com/glennrp/libpng or
+    https://git.code.sf.net/p/libpng/code.git
 
-or you can browse it with a web browser by selecting the "code" button at
+or you can browse it with a web browser at
 
-    https://sourceforge.net/projects/libpng
+    https://github.com/glennrp/libpng or
+    https://sourceforge.net/p/libpng/code/ci/libpng16/tree/
 
 Patches can be sent to glennrp at users.sourceforge.net or to
 png-mng-implement at lists.sourceforge.net or you can upload them to
 the libpng bug tracker at
 
-    http://libpng.sourceforge.net
+    https://libpng.sourceforge.io/
 
+or as a "pull request" to
+
+    https://github.com/glennrp/libpng/pulls
+
 We also accept patches built from the tar or zip distributions, and
 simple verbal discriptions of bug fixes, reported either to the
 SourceForge bug tracker, to the png-mng-implement at lists.sf.net
-mailing list, or directly to glennrp.
+mailing list, as github issues, or directly to glennrp.
 
 XV. Coding style
 
 Our coding style is similar to the "Allman" style
-(See http://en.wikipedia.org/wiki/Indent_style#Allman_style), with curly
+(See https://en.wikipedia.org/wiki/Indent_style#Allman_style), with curly
 braces on separate lines:
 
     if (condition)
@@ -5315,7 +5374,7 @@
 though it were a function.
 
 Control keywords if, for, while, and switch are always followed by a space
-to distinguish them from function calls, which have no trailing space. 
+to distinguish them from function calls, which have no trailing space.
 
 We put a space after each comma and after each semicolon
 in "for" statements, and we put spaces before and after each
@@ -5341,7 +5400,7 @@
 
 We prefer "if (something != 0)" and "if (something == 0)" over
 "if (something)" and if "(!something)", respectively, and for pointers
-we prefer "if (some_pointer != NULL)" or "if (some_pointer == NULL)". 
+we prefer "if (some_pointer != NULL)" or "if (some_pointer == NULL)".
 
 We do not use the TAB character for indentation in the C sources.
 
@@ -5355,7 +5414,7 @@
 an official declaration.
 
 This is your unofficial assurance that libpng from version 0.71 and
-upward through 1.6.29 are Y2K compliant.  It is my belief that earlier
+upward through 1.6.34 are Y2K compliant.  It is my belief that earlier
 versions were also Y2K compliant.
 
 Libpng only has two year fields.  One is a 2-byte unsigned integer

Modified: branches/stable/source/src/libs/libpng/libpng-src/libpng.3
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/libpng.3	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/libpng.3	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,6 +1,6 @@
-.TH LIBPNG 3 "March 16, 2017"
+.TH LIBPNG 3 "September 29, 2017"
 .SH NAME
-libpng \- Portable Network Graphics (PNG) Reference Library 1.6.29
+libpng \- Portable Network Graphics (PNG) Reference Library 1.6.34
 .SH SYNOPSIS
 \fB
 #include <png.h>\fP
@@ -97,6 +97,10 @@
 
 \fBpng_byte png_get_header_version (png_const_structp \fIpng_ptr\fP\fB);\fP
 
+\fBpng_uint_32 png_get_eXIf (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fP\fIinfo_ptr\fP\fB, png_bytep \fI*exif\fP\fB);\fP
+
+\fBpng_uint_32 png_get_eXIf_1 (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fP\fIinfo_ptr\fP\fB, png_unit_32 \fP\fI*num_exif\fP\fB, png_bytep \fI*exif\fP\fB);\fP
+
 \fBpng_uint_32 png_get_hIST (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fP\fIinfo_ptr\fP\fB, png_uint_16p \fI*hist\fP\fB);\fP
 
 \fBpng_uint_32 png_get_iCCP (png_const_structp \fP\fIpng_ptr\fP\fB, png_const_infop \fP\fIinfo_ptr\fP\fB, png_charpp \fP\fIname\fP\fB, int \fP\fI*compression_type\fP\fB, png_bytepp \fP\fIprofile\fP\fB, png_uint_32 \fI*proflen\fP\fB);\fP
@@ -347,6 +351,10 @@
 
 \fBvoid png_set_gray_to_rgb (png_structp \fIpng_ptr\fP\fB);\fP
 
+\fBvoid png_set_eXIf (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_bytep \fIexif\fP\fB);\fP
+
+\fBvoid png_set_eXIf_1 (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, const png_uint_32 \fP\fInum_exif\fP\fB, png_bytep \fIexif\fP\fB);\fP
+
 \fBvoid png_set_hIST (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_16p \fIhist\fP\fB);\fP
 
 \fBvoid png_set_iCCP (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_const_charp \fP\fIname\fP\fB, int \fP\fIcompression_type\fP\fB, png_const_bytep \fP\fIprofile\fP\fB, png_uint_32 \fIproflen\fP\fB);\fP
@@ -510,10 +518,10 @@
 .SH LIBPNG.TXT
 libpng-manual.txt - A description on how to use and modify libpng
 
- libpng version 1.6.29 - March 16, 2017
+ libpng version 1.6.34 - September 29, 2017
  Updated and distributed by Glenn Randers-Pehrson
  <glennrp at users.sourceforge.net>
- Copyright (c) 1998-2016 Glenn Randers-Pehrson
+ Copyright (c) 1998-2017 Glenn Randers-Pehrson
 
  This document is released under the libpng license.
  For conditions of distribution and use, see the disclaimer
@@ -521,9 +529,9 @@
 
  Based on:
 
- libpng versions 0.97, January 1998, through 1.6.29 - March 16, 2017
+ libpng versions 0.97, January 1998, through 1.6.34 - September 29, 2017
  Updated and distributed by Glenn Randers-Pehrson
- Copyright (c) 1998-2016 Glenn Randers-Pehrson
+ Copyright (c) 1998-2017 Glenn Randers-Pehrson
 
  libpng 1.0 beta 6 - version 0.96 - May 28, 1997
  Updated and distributed by Andreas Dilger
@@ -576,17 +584,17 @@
 
 The PNG specification (second edition), November 2003, is available as
 a W3C Recommendation and as an ISO Standard (ISO/IEC 15948:2004 (E)) at
-<http://www.w3.org/TR/2003/REC-PNG-20031110/
+<https://www.w3.org/TR/2003/REC-PNG-20031110/
 The W3C and ISO documents have identical technical content.
 
 The PNG-1.2 specification is available at
-<http://png-mng.sourceforge.net/pub/png/spec/1.2/>.
+<https://png-mng.sourceforge.io/pub/png/spec/1.2/>.
 It is technically equivalent
 to the PNG specification (second edition) but has some additional material.
 
-The PNG-1.0 specification is available as RFC 2083 
-<http://png-mng.sourceforge.net/pub/png/spec/1.0/> and as a
-W3C Recommendation <http://www.w3.org/TR/REC-png-961001>.
+The PNG-1.0 specification is available as RFC 2083
+<https://png-mng.sourceforge.io/pub/png/spec/1.0/> and as a
+W3C Recommendation <https://www.w3.org/TR/REC-png-961001>.
 
 Some additional chunks are described in the special-purpose public chunks
 documents at <http://www.libpng.org/pub/png/spec/register/>
@@ -611,7 +619,7 @@
 
 Libpng uses zlib for its compression and decompression of PNG files.
 Further information about zlib, and the latest version of zlib, can
-be found at the zlib home page, <http://zlib.net/>.
+be found at the zlib home page, <https://zlib.net/>.
 The zlib compression utility is a general purpose utility that is
 useful for more than PNG files, and can be used without libpng.
 See the documentation delivered with zlib for more details.
@@ -1198,8 +1206,9 @@
    chunk_cache_max = png_get_chunk_cache_max(png_ptr);
 
 Libpng imposes a limit of 8 Megabytes (8,000,000 bytes) on the amount of
-memory that a compressed chunk other than IDAT can occupy, when decompressed.
-You can change this limit with
+memory that any chunk other than IDAT can occupy, originally or when
+decompressed (prior to libpng-1.6.32 the limit was only applied to compressed
+chunks after decompression). You can change this limit with
 
    png_set_chunk_malloc_max(png_ptr, user_chunk_malloc_max);
 
@@ -1495,8 +1504,17 @@
 
     png_set_alpha_mode(pp, PNG_ALPHA_PNG, PNG_DEFAULT_sRGB);
 
-This is the default libpng handling of the alpha channel - it is not
-pre-multiplied into the color components.  In addition the call states
+Choices for the alpha_mode are
+
+    PNG_ALPHA_PNG           0 /* according to the PNG standard */
+    PNG_ALPHA_STANDARD      1 /* according to Porter/Duff */
+    PNG_ALPHA_ASSOCIATED    1 /* as above; this is the normal practice */
+    PNG_ALPHA_PREMULTIPLIED 1 /* as above */
+    PNG_ALPHA_OPTIMIZED     2 /* 'PNG' for opaque pixels, else 'STANDARD' */
+    PNG_ALPHA_BROKEN        3 /* the alpha channel is gamma encoded */
+
+PNG_ALPHA_PNG is the default libpng handling of the alpha channel. It is not
+pre-multiplied into the color components. In addition the call states
 that the output is for a sRGB system and causes all PNG files without gAMA
 chunks to be assumed to be encoded using sRGB.
 
@@ -1511,7 +1529,7 @@
 This is the classic Jim Blinn approach and will work in academic
 environments where everything is done by the book.  It has the shortcoming
 of assuming that input PNG data with no gamma information is linear - this
-is unlikely to be correct unless the PNG files where generated locally.
+is unlikely to be correct unless the PNG files were generated locally.
 Most of the time the output precision will be so low as to show
 significant banding in dark areas of the image.
 
@@ -1700,8 +1718,21 @@
    png_set_rows(png_ptr, info_ptr, &row_pointers);
 
 Alternatively you could allocate your image in one big block and define
-row_pointers[i] to point into the proper places in your block.
+row_pointers[i] to point into the proper places in your block, but first
+be sure that your platform is able to allocate such a large buffer:
 
+   /* Guard against integer overflow */
+   if (height > PNG_SIZE_MAX/(width*pixel_size)) {
+        png_error(png_ptr,"image_data buffer would be too large");
+   }
+
+   png_bytep buffer=png_malloc(png_ptr,height*width*pixel_size);
+
+   for (int i=0; i<height, i++)
+      row_pointers[i]=buffer+i*width*pixel_size;
+
+   png_set_rows(png_ptr, info_ptr, &row_pointers);
+
 If you use png_set_rows(), the application is responsible for freeing
 row_pointers (and row_pointers[i], if they were separately allocated).
 
@@ -1827,6 +1858,11 @@
     rowbytes = png_get_rowbytes(png_ptr, info_ptr);
 
     rowbytes       - number of bytes needed to hold a row
+                     This value, the bit_depth, color_type,
+                     and the number of channels can change
+                     if you use transforms such as
+                     png_set_expand(). See
+                     png_read_update_info(), below.
 
     signature = png_get_signature(png_ptr, info_ptr);
 
@@ -1945,6 +1981,11 @@
                      the single transparent color for
                      non-paletted images (PNG_INFO_tRNS)
 
+    png_get_eXIf_1(png_ptr, info_ptr, &num_exif, &exif);
+                     (PNG_INFO_eXIf)
+
+    exif           - Exif profile (array of png_byte)
+
     png_get_hIST(png_ptr, info_ptr, &hist);
                      (PNG_INFO_hIST)
 
@@ -2656,6 +2697,16 @@
 array of pointers to each row, as it will be needed for some
 of the functions below.
 
+Be sure that your platform can allocate the buffer that you'll need.
+libpng internally checks for oversize width, but you'll need to
+do your own check for number_of_rows*width*pixel_size if you are using
+a multiple-row buffer:
+
+   /* Guard against integer overflow */
+   if (number_of_rows > PNG_SIZE_MAX/(width*pixel_size)) {
+        png_error(png_ptr,"image_data buffer would be too large");
+   }
+
 Remember: Before you call png_read_update_info(), the png_get_*()
 functions return the values corresponding to the original PNG image.
 After you call png_read_update_info the values refer to the image
@@ -2980,6 +3031,7 @@
              PNG_INFO_gAMA, PNG_INFO_sBIT,
              PNG_INFO_cHRM, PNG_INFO_PLTE,
              PNG_INFO_tRNS, PNG_INFO_bKGD,
+             PNG_INFO_eXIf,
              PNG_INFO_hIST, PNG_INFO_pHYs,
              PNG_INFO_oFFs, PNG_INFO_tIME,
              PNG_INFO_pCAL, PNG_INFO_sRGB,
@@ -3579,6 +3631,11 @@
                      single transparent color for
                      non-paletted images (PNG_INFO_tRNS)
 
+    png_set_eXIf_1(png_ptr, info_ptr, num_exif, exif);
+
+    exif           - Exif profile (array of
+                     png_byte) (PNG_INFO_eXIf)
+
     png_set_hIST(png_ptr, info_ptr, hist);
 
     hist           - histogram of palette (array of
@@ -4334,7 +4391,7 @@
 
 When the simplified API needs to convert between sRGB and linear colorspaces,
 the actual sRGB transfer curve defined in the sRGB specification (see the
-article at http://en.wikipedia.org/wiki/SRGB) is used, not the gamma=1/2.2
+article at https://en.wikipedia.org/wiki/SRGB) is used, not the gamma=1/2.2
 approximation used elsewhere in libpng.
 
 When an alpha channel is present it is expected to denote pixel coverage
@@ -4598,7 +4655,7 @@
 
 When the simplified API needs to convert between sRGB and linear colorspaces,
 the actual sRGB transfer curve defined in the sRGB specification (see the
-article at http://en.wikipedia.org/wiki/SRGB) is used, not the gamma=1/2.2
+article at https://en.wikipedia.org/wiki/SRGB) is used, not the gamma=1/2.2
 approximation used elsewhere in libpng.
 
 WRITE APIS
@@ -4756,8 +4813,6 @@
         png_voidp error_ptr, png_error_ptr error_fn,
         png_error_ptr warning_fn);
 
-    png_voidp error_ptr = png_get_error_ptr(png_ptr);
-
 If NULL is supplied for either error_fn or warning_fn, then the libpng
 default function will be used, calling fprintf() and/or longjmp() if a
 problem is encountered.  The replacement error functions should have
@@ -4769,6 +4824,11 @@
     void user_warning_fn(png_structp png_ptr,
         png_const_charp warning_msg);
 
+Then, within your user_error_fn or user_warning_fn, you can retrieve
+the error_ptr if you need it, by calling
+
+    png_voidp error_ptr = png_get_error_ptr(png_ptr);
+
 The motivation behind using setjmp() and longjmp() is the C++ throw and
 catch exception handling methods.  This makes the code much easier to write,
 as there is no need to check every return code of every function call.
@@ -4776,7 +4836,7 @@
 after a longjmp, so the user may want to be careful about doing anything
 after setjmp returns non-zero besides returning itself.  Consult your
 compiler documentation for more details.  For an alternative approach, you
-may wish to use the "cexcept" facility (see http://cexcept.sourceforge.net),
+may wish to use the "cexcept" facility (see https://cexcept.sourceforge.io/),
 which is illustrated in pngvalid.c and in contrib/visupng.
 
 Beginning in libpng-1.4.0, the png_set_benign_errors() API became available.
@@ -5004,7 +5064,7 @@
 and the MHDR and MEND chunks.  Libpng does not provide support for these
 or any other MNG chunks; your application must provide its own support for
 them.  You may wish to consider using libmng (available at
-http://www.libmng.com) instead.
+https://www.libmng.com/) instead.
 
 .SH VIII.  Changes to Libpng from version 0.88
 
@@ -5427,18 +5487,14 @@
 that it could be used to override them.  Now this function will reduce or
 increase the limits.
 
-Starting in libpng-1.5.10, the user limits can be set en masse with the
-configuration option PNG_SAFE_LIMITS_SUPPORTED.  If this option is enabled,
-a set of "safe" limits is applied in pngpriv.h.  These can be overridden by
-application calls to png_set_user_limits(), png_set_user_chunk_cache_max(),
-and/or png_set_user_malloc_max() that increase or decrease the limits.  Also,
-in libpng-1.5.10 the default width and height limits were increased
-from 1,000,000 to 0x7fffffff (i.e., made unlimited).  Therefore, the
-limits are now
-                               default      safe
+Starting in libpng-1.5.22, default user limits were established. These
+can be overridden by application calls to png_set_user_limits(),
+png_set_user_chunk_cache_max(), and/or png_set_user_malloc_max().
+The limits are now
+                             max possible  default
    png_user_width_max        0x7fffffff    1,000,000
    png_user_height_max       0x7fffffff    1,000,000
-   png_user_chunk_cache_max  0 (unlimited)   128
+   png_user_chunk_cache_max  0 (unlimited) 1000
    png_user_chunk_malloc_max 0 (unlimited) 8,000,000
 
 The png_set_option() function (and the "options" member of the png struct) was
@@ -5688,6 +5744,11 @@
 enforced, and the palette was always limited to 256 entries. An over-length
 PLTE chunk found in an input PNG is silently truncated.
 
+Starting with libpng-1.6.31, the eXIf chunk is supported. Libpng does not
+attempt to decode the Exif profile; it simply returns a byte array
+containing the profile to the calling application which must do its own
+decoding.
+
 .SH XIII.  Detecting libpng
 
 The png_get_io_ptr() function has been present since libpng-0.88, has never
@@ -5704,27 +5765,33 @@
 going back to version 0.70.  You can access the git repository (read only)
 at
 
-    git://git.code.sf.net/p/libpng/code
+    https://github.com/glennrp/libpng or
+    https://git.code.sf.net/p/libpng/code.git
 
-or you can browse it with a web browser by selecting the "code" button at
+or you can browse it with a web browser at
 
-    https://sourceforge.net/projects/libpng
+    https://github.com/glennrp/libpng or
+    https://sourceforge.net/p/libpng/code/ci/libpng16/tree/
 
 Patches can be sent to glennrp at users.sourceforge.net or to
 png-mng-implement at lists.sourceforge.net or you can upload them to
 the libpng bug tracker at
 
-    http://libpng.sourceforge.net
+    https://libpng.sourceforge.io/
 
+or as a "pull request" to
+
+    https://github.com/glennrp/libpng/pulls
+
 We also accept patches built from the tar or zip distributions, and
 simple verbal discriptions of bug fixes, reported either to the
 SourceForge bug tracker, to the png-mng-implement at lists.sf.net
-mailing list, or directly to glennrp.
+mailing list, as github issues, or directly to glennrp.
 
 .SH XV. Coding style
 
 Our coding style is similar to the "Allman" style
-(See http://en.wikipedia.org/wiki/Indent_style#Allman_style), with curly
+(See https://en.wikipedia.org/wiki/Indent_style#Allman_style), with curly
 braces on separate lines:
 
     if (condition)
@@ -5825,7 +5892,7 @@
 though it were a function.
 
 Control keywords if, for, while, and switch are always followed by a space
-to distinguish them from function calls, which have no trailing space. 
+to distinguish them from function calls, which have no trailing space.
 
 We put a space after each comma and after each semicolon
 in "for" statements, and we put spaces before and after each
@@ -5851,7 +5918,7 @@
 
 We prefer "if (something != 0)" and "if (something == 0)" over
 "if (something)" and if "(!something)", respectively, and for pointers
-we prefer "if (some_pointer != NULL)" or "if (some_pointer == NULL)". 
+we prefer "if (some_pointer != NULL)" or "if (some_pointer == NULL)".
 
 We do not use the TAB character for indentation in the C sources.
 
@@ -5865,7 +5932,7 @@
 an official declaration.
 
 This is your unofficial assurance that libpng from version 0.71 and
-upward through 1.6.29 are Y2K compliant.  It is my belief that earlier
+upward through 1.6.34 are Y2K compliant.  It is my belief that earlier
 versions were also Y2K compliant.
 
 Libpng only has two year fields.  One is a 2-byte unsigned integer
@@ -5963,11 +6030,11 @@
  ...
  1.0.19                  10    10019  10.so.0.19[.0]
  ...
- 1.2.57                  13    10257  12.so.0.56[.0]
+ 1.2.59                  13    10259  12.so.0.59[.0]
  ...
- 1.5.28                  15    10528  15.so.15.28[.0]
+ 1.5.30                  15    10530  15.so.15.30[.0]
  ...
- 1.6.29                  16    10629  16.so.16.29[.0]
+ 1.6.34                  16    10634  16.so.16.34[.0]
 
 Henceforth the source version will match the shared-library minor
 and patch numbers; the shared-library major version number will be
@@ -5984,7 +6051,7 @@
 .LP
 .IR libpng :
 .IP
-http://libpng.sourceforge.net (follow the [DOWNLOAD] link)
+https://libpng.sourceforge.io/ (follow the [DOWNLOAD] link)
 http://www.libpng.org/pub/png
 
 .LP
@@ -5994,7 +6061,7 @@
 .I libpng
 or at
 .br
-ftp://ftp.info-zip.org/pub/infozip/zlib
+https://zlib.net/
 
 .LP
 .IR PNG specification: RFC 2083
@@ -6003,11 +6070,11 @@
 .I libpng
 or at
 .br
-ftp://ftp.rfc-editor.org:/in-notes/rfc2083.txt
+https://www.ietf.org/rfc/rfc2083.txt
 .br
 or (as a W3C Recommendation) at
 .br
-http://www.w3.org/TR/REC-png.html
+https://www.w3.org/TR/REC-png.html
 
 .LP
 In the case of any inconsistency between the PNG specification
@@ -6023,7 +6090,7 @@
 
 Thanks to Frank J. T. Wojcik for helping with the documentation.
 
-Libpng version 1.6.29 - March 16, 2017:
+Libpng version 1.6.34 - September 29, 2017:
 Initially created in 1995 by Guy Eric Schalnat, then of Group 42, Inc.
 Currently maintained by Glenn Randers-Pehrson (glennrp at users.sourceforge.net).
 
@@ -6048,7 +6115,7 @@
 
 This code is released under the libpng license.
 
-libpng versions 1.0.7, July 1, 2000 through 1.6.29, March 16, 2017 are
+libpng versions 1.0.7, July 1, 2000 through 1.6.34, September 29, 2017 are
 Copyright (c) 2000-2002, 2004, 2006-2017 Glenn Randers-Pehrson, are
 derived from libpng-1.0.6, and are distributed according to the same
 disclaimer and license as libpng-1.0.6 with the following individuals
@@ -6176,7 +6243,7 @@
 
 Glenn Randers-Pehrson
 glennrp at users.sourceforge.net
-March 16, 2017
+September 29, 2017
 
 .\" end of man page
 

Modified: branches/stable/source/src/libs/libpng/libpng-src/libpng.pc.in
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/libpng.pc.in	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/libpng.pc.in	2017-11-01 18:15:56 UTC (rev 780)
@@ -6,6 +6,7 @@
 Name: libpng
 Description: Loads and saves PNG files
 Version: @PNGLIB_VERSION@
+Requires: zlib
 Libs: -L${libdir} -lpng at PNGLIB_MAJOR@@PNGLIB_MINOR@
 Libs.private: @LIBS@
 Cflags: -I${includedir}

Modified: branches/stable/source/src/libs/libpng/libpng-src/libpngpf.3
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/libpngpf.3	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/libpngpf.3	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,11 +1,11 @@
-.TH LIBPNGPF 3 "March 16, 2017"
+.TH LIBPNGPF 3 "April 1, 2017"
 .SH NAME
-libpng \- Portable Network Graphics (PNG) Reference Library 1.6.29
+libpng \- Portable Network Graphics (PNG) Reference Library 1.6.34
 (private functions)
 .SH SYNOPSIS
-\fB#include \fI"pngpriv.h"
+\fB\fB#include \fI\fI"pngpriv.h"
 
-\fBAs of libpng version \fP\fI1.5.1\fP\fB, this section is no longer \fP\fImaintained\fP\fB, now that the private function prototypes are hidden in pngpriv.h and not accessible to applications. Look in pngpriv.h for the prototypes and a short description of each \fIfunction.
+\fB\fBAs of libpng version \fP\fI\fP\fI1.5.1\fP\fB\fP\fB, this section is no longer \fP\fI\fP\fImaintained\fP\fB\fP\fB, now that the private function prototypes are hidden in pngpriv.h and not accessible to applications. Look in pngpriv.h for the prototypes and a short description of each \fI\fIfunction.
 
 .SH DESCRIPTION
 The functions previously listed here are used privately by libpng and are not

Modified: branches/stable/source/src/libs/libpng/libpng-src/png.5
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/png.5	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/png.5	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,4 +1,4 @@
-.TH PNG 5 "March 16, 2017"
+.TH PNG 5 "April 1, 2017"
 .SH NAME
 png \- Portable Network Graphics (PNG) format
 .SH DESCRIPTION
@@ -23,11 +23,11 @@
 PNG specification (second edition), November 2003:
 .IP
 .br
-  <http://www.w3.org/TR/2003/REC-PNG-20031110/
+  <https://www.w3.org/TR/2003/REC-PNG-20031110/
 PNG 1.2 specification, July 1999:
 .IP
 .br
-http://png-mng.sourceforge.net/pub/png/spec/1.2/
+https://png-mng.sourceforge.io/pub/png/spec/1.2/
 .LP
 PNG 1.0 specification, October 1996:
 .IP
@@ -35,11 +35,11 @@
 RFC 2083
 .IP
 .br
-http://www.ietf.org/rfc/rfc2083.txt
+https://www.ietf.org/rfc/rfc2083.txt
 .br
 or (as a W3C Recommendation) at
 .br
-http://www.w3.org/TR/REC-png-961001
+https://www.w3.org/TR/REC-png-961001
 .SH AUTHORS
 This man page: Glenn Randers-Pehrson
 .LP

Modified: branches/stable/source/src/libs/libpng/libpng-src/png.c
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/png.c	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/png.c	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,7 +1,7 @@
 
 /* png.c - location for general purpose libpng functions
  *
- * Last changed in libpng 1.6.29 [March 16, 2017]
+ * Last changed in libpng 1.6.33 [September 28, 2017]
  * Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
  * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
@@ -14,8 +14,28 @@
 #include "pngpriv.h"
 
 /* Generate a compiler error if there is an old png.h in the search path. */
-typedef png_libpng_version_1_6_29 Your_png_h_is_not_version_1_6_29;
+typedef png_libpng_version_1_6_34 Your_png_h_is_not_version_1_6_34;
 
+#ifdef __GNUC__
+/* The version tests may need to be added to, but the problem warning has
+ * consistently been fixed in GCC versions which obtain wide-spread release.
+ * The problem is that many versions of GCC rearrange comparison expressions in
+ * the optimizer in such a way that the results of the comparison will change
+ * if signed integer overflow occurs.  Such comparisons are not permitted in
+ * ANSI C90, however GCC isn't clever enough to work out that that do not occur
+ * below in png_ascii_from_fp and png_muldiv, so it produces a warning with
+ * -Wextra.  Unfortunately this is highly dependent on the optimizer and the
+ * machine architecture so the warning comes and goes unpredictably and is
+ * impossible to "fix", even were that a good idea.
+ */
+#if __GNUC__ == 7 && __GNUC_MINOR__ == 1
+#define GCC_STRICT_OVERFLOW 1
+#endif /* GNU 7.1.x */
+#endif /* GNU */
+#ifndef GCC_STRICT_OVERFLOW
+#define GCC_STRICT_OVERFLOW 0
+#endif
+
 /* Tells libpng that we have already handled the first "num_bytes" bytes
  * of the PNG file signature.  If the PNG data is embedded into another
  * stream we can set num_bytes = 8 so that libpng will not attempt to read
@@ -595,6 +615,26 @@
    }
 #endif
 
+#ifdef PNG_eXIf_SUPPORTED
+   /* Free any eXIf entry */
+   if (((mask & PNG_FREE_EXIF) & info_ptr->free_me) != 0)
+   {
+# ifdef PNG_READ_eXIf_SUPPORTED
+      if (info_ptr->eXIf_buf)
+      {
+         png_free(png_ptr, info_ptr->eXIf_buf);
+         info_ptr->eXIf_buf = NULL;
+      }
+# endif
+      if (info_ptr->exif)
+      {
+         png_free(png_ptr, info_ptr->exif);
+         info_ptr->exif = NULL;
+      }
+      info_ptr->valid &= ~PNG_INFO_eXIf;
+   }
+#endif
+
 #ifdef PNG_hIST_SUPPORTED
    /* Free any hIST entry */
    if (((mask & PNG_FREE_HIST) & info_ptr->free_me) != 0)
@@ -776,7 +816,7 @@
 #else
 #  ifdef __STDC__
    return PNG_STRING_NEWLINE \
-      "libpng version 1.6.29 - March 16, 2017" PNG_STRING_NEWLINE \
+      "libpng version 1.6.34 - September 29, 2017" PNG_STRING_NEWLINE \
       "Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson" \
       PNG_STRING_NEWLINE \
       "Copyright (c) 1996-1997 Andreas Dilger" PNG_STRING_NEWLINE \
@@ -783,7 +823,7 @@
       "Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc." \
       PNG_STRING_NEWLINE;
 #  else
-   return "libpng version 1.6.29 - March 16, 2017\
+   return "libpng version 1.6.34 - September 29, 2017\
       Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson\
       Copyright (c) 1996-1997 Andreas Dilger\
       Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.";
@@ -1873,12 +1913,12 @@
     */
    if (intent < 0 || intent >= PNG_sRGB_INTENT_LAST)
       return png_icc_profile_error(png_ptr, colorspace, "sRGB",
-          (unsigned)intent, "invalid sRGB rendering intent");
+          (png_alloc_size_t)intent, "invalid sRGB rendering intent");
 
    if ((colorspace->flags & PNG_COLORSPACE_HAVE_INTENT) != 0 &&
        colorspace->rendering_intent != intent)
       return png_icc_profile_error(png_ptr, colorspace, "sRGB",
-         (unsigned)intent, "inconsistent rendering intents");
+         (png_alloc_size_t)intent, "inconsistent rendering intents");
 
    if ((colorspace->flags & PNG_COLORSPACE_FROM_sRGB) != 0)
    {
@@ -1939,7 +1979,6 @@
    if (profile_length < 132)
       return png_icc_profile_error(png_ptr, colorspace, name, profile_length,
           "too short");
-
    return 1;
 }
 
@@ -2184,9 +2223,17 @@
        * being in range.  All defined tag types have an 8 byte header - a 4 byte
        * type signature then 0.
        */
+
+      /* This is a hard error; potentially it can cause read outside the
+       * profile.
+       */
+      if (tag_start > profile_length || tag_length > profile_length - tag_start)
+         return png_icc_profile_error(png_ptr, colorspace, name, tag_id,
+             "ICC profile tag outside profile");
+
       if ((tag_start & 3) != 0)
       {
-         /* CNHP730S.icc shipped with Microsoft Windows 64 violates this, it is
+         /* CNHP730S.icc shipped with Microsoft Windows 64 violates this; it is
           * only a warning here because libpng does not care about the
           * alignment.
           */
@@ -2193,13 +2240,6 @@
          (void)png_icc_profile_error(png_ptr, NULL, name, tag_id,
              "ICC profile tag start not a multiple of 4");
       }
-
-      /* This is a hard error; potentially it can cause read outside the
-       * profile.
-       */
-      if (tag_start > profile_length || tag_length > profile_length - tag_start)
-         return png_icc_profile_error(png_ptr, colorspace, name, tag_id,
-             "ICC profile tag outside profile");
    }
 
    return 1; /* success, maybe with warnings */
@@ -2832,7 +2872,7 @@
    if (power < 0)
    {
       if (power < DBL_MIN_10_EXP) return 0;
-      recip = 1, power = -power;
+      recip = 1; power = -power;
    }
 
    if (power > 0)
@@ -2857,6 +2897,14 @@
 /* Function to format a floating point value in ASCII with a given
  * precision.
  */
+#if GCC_STRICT_OVERFLOW
+#pragma GCC diagnostic push
+/* The problem arises below with exp_b10, which can never overflow because it
+ * comes, originally, from frexp and is therefore limited to a range which is
+ * typically +/-710 (log2(DBL_MAX)/log2(DBL_MIN)).
+ */
+#pragma GCC diagnostic warning "-Wstrict-overflow=2"
+#endif /* GCC_STRICT_OVERFLOW */
 void /* PRIVATE */
 png_ascii_from_fp(png_const_structrp png_ptr, png_charp ascii, png_size_t size,
     double fp, unsigned int precision)
@@ -2910,7 +2958,9 @@
             double test = png_pow10(exp_b10+1);
 
             if (test <= DBL_MAX)
-               ++exp_b10, base = test;
+            {
+               ++exp_b10; base = test;
+            }
 
             else
                break;
@@ -2924,7 +2974,10 @@
           * test on DBL_MAX above.
           */
          fp /= base;
-         while (fp >= 1) fp /= 10, ++exp_b10;
+         while (fp >= 1)
+         {
+            fp /= 10; ++exp_b10;
+         }
 
          /* Because of the code above fp may, at this point, be
           * less than .1, this is ok because the code below can
@@ -2941,7 +2994,7 @@
              */
             if (exp_b10 < 0 && exp_b10 > -3) /* PLUS 3 TOTAL 4 */
             {
-               czero = (unsigned int)(-exp_b10); /* PLUS 2 digits: TOTAL 3 */
+               czero = 0U-exp_b10; /* PLUS 2 digits: TOTAL 3 */
                exp_b10 = 0;      /* Dot added below before first output. */
             }
             else
@@ -2975,7 +3028,7 @@
                      /* Rounding up to 10, handle that here. */
                      if (czero > 0)
                      {
-                        --czero, d = 1;
+                        --czero; d = 1;
                         if (cdigits == 0) --clead;
                      }
                      else
@@ -2989,7 +3042,7 @@
 
                            else if (ch == 46)
                            {
-                              ch = *--ascii, ++size;
+                              ch = *--ascii; ++size;
                               /* Advance exp_b10 to '1', so that the
                                * decimal point happens after the
                                * previous digit.
@@ -3016,7 +3069,9 @@
                               int ch = *--ascii;
 
                               if (ch == 46)
-                                 ++size, exp_b10 = 1;
+                              {
+                                 ++size; exp_b10 = 1;
+                              }
 
                               /* Else lost a leading zero, so 'exp_b10' is
                                * still ok at (-1)
@@ -3052,21 +3107,26 @@
                       */
                      if (exp_b10 != (-1))
                      {
-                        if (exp_b10 == 0) *ascii++ = 46, --size;
+                        if (exp_b10 == 0)
+                        {
+                           *ascii++ = 46; --size;
+                        }
                         /* PLUS 1: TOTAL 4 */
                         --exp_b10;
                      }
-                     *ascii++ = 48, --czero;
+                     *ascii++ = 48; --czero;
                   }
 
                   if (exp_b10 != (-1))
                   {
                      if (exp_b10 == 0)
-                        *ascii++ = 46, --size; /* counted above */
+                     {
+                        *ascii++ = 46; --size; /* counted above */
+                     }
 
                      --exp_b10;
                   }
-                  *ascii++ = (char)(48 + (int)d), ++cdigits;
+                  *ascii++ = (char)(48 + (int)d); ++cdigits;
                }
             }
             while (cdigits+czero < precision+clead && fp > DBL_MIN);
@@ -3075,7 +3135,7 @@
 
             /* Check for an exponent, if we don't need one we are
              * done and just need to terminate the string.  At
-             * this point exp_b10==(-1) is effectively if flag - it got
+             * this point exp_b10==(-1) is effectively a flag - it got
              * to '-1' because of the decrement after outputting
              * the decimal point above (the exponent required is
              * *not* -1!)
@@ -3089,7 +3149,7 @@
                 * zeros were *not* output, so this doesn't increase
                 * the output count.
                 */
-               while (--exp_b10 >= 0) *ascii++ = 48;
+               while (exp_b10-- > 0) *ascii++ = 48;
 
                *ascii = 0;
 
@@ -3107,7 +3167,7 @@
              */
             size -= cdigits;
 
-            *ascii++ = 69, --size;    /* 'E': PLUS 1 TOTAL 2+precision */
+            *ascii++ = 69; --size;    /* 'E': PLUS 1 TOTAL 2+precision */
 
             /* The following use of an unsigned temporary avoids ambiguities in
              * the signed arithmetic on exp_b10 and permits GCC at least to do
@@ -3118,12 +3178,12 @@
 
                if (exp_b10 < 0)
                {
-                  *ascii++ = 45, --size; /* '-': PLUS 1 TOTAL 3+precision */
-                  uexp_b10 = (unsigned int)(-exp_b10);
+                  *ascii++ = 45; --size; /* '-': PLUS 1 TOTAL 3+precision */
+                  uexp_b10 = 0U-exp_b10;
                }
 
                else
-                  uexp_b10 = (unsigned int)exp_b10;
+                  uexp_b10 = 0U+exp_b10;
 
                cdigits = 0;
 
@@ -3166,6 +3226,9 @@
    /* Here on buffer too small. */
    png_error(png_ptr, "ASCII conversion buffer too small");
 }
+#if GCC_STRICT_OVERFLOW
+#pragma GCC diagnostic pop
+#endif /* GCC_STRICT_OVERFLOW */
 
 #  endif /* FLOATING_POINT */
 
@@ -3185,7 +3248,9 @@
 
       /* Avoid overflow here on the minimum integer. */
       if (fp < 0)
-         *ascii++ = 45, num = (png_uint_32)(-fp);
+      {
+         *ascii++ = 45; num = (png_uint_32)(-fp);
+      }
       else
          num = (png_uint_32)fp;
 
@@ -3223,7 +3288,10 @@
                 * then ndigits digits to first:
                 */
                i = 5;
-               while (ndigits < i) *ascii++ = 48, --i;
+               while (ndigits < i)
+               {
+                  *ascii++ = 48; --i;
+               }
                while (ndigits >= first) *ascii++ = digits[--ndigits];
                /* Don't output the trailing zeros! */
             }
@@ -3274,6 +3342,15 @@
  * the nearest .00001).  Overflow and divide by zero are signalled in
  * the result, a boolean - true on success, false on overflow.
  */
+#if GCC_STRICT_OVERFLOW /* from above */
+/* It is not obvious which comparison below gets optimized in such a way that
+ * signed overflow would change the result; looking through the code does not
+ * reveal any tests which have the form GCC complains about, so presumably the
+ * optimizer is moving an add or subtract into the 'if' somewhere.
+ */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic warning "-Wstrict-overflow=2"
+#endif /* GCC_STRICT_OVERFLOW */
 int
 png_muldiv(png_fixed_point_p res, png_fixed_point a, png_int_32 times,
     png_int_32 divisor)
@@ -3388,6 +3465,9 @@
 
    return 0;
 }
+#if GCC_STRICT_OVERFLOW
+#pragma GCC diagnostic pop
+#endif /* GCC_STRICT_OVERFLOW */
 #endif /* READ_GAMMA || INCH_CONVERSIONS */
 
 #if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_INCH_CONVERSIONS_SUPPORTED)
@@ -3681,7 +3761,7 @@
  * of getting this accuracy in practice.
  *
  * To deal with this the following exp() function works out the exponent of the
- * frational part of the logarithm by using an accurate 32-bit value from the
+ * fractional part of the logarithm by using an accurate 32-bit value from the
  * top four fractional bits then multiplying in the remaining bits.
  */
 static const png_uint_32
@@ -4278,7 +4358,7 @@
    defined(PNG_SIMPLIFIED_WRITE_SUPPORTED)
 /* sRGB conversion tables; these are machine generated with the code in
  * contrib/tools/makesRGB.c.  The actual sRGB transfer curve defined in the
- * specification (see the article at http://en.wikipedia.org/wiki/SRGB)
+ * specification (see the article at https://en.wikipedia.org/wiki/SRGB)
  * is used, not the gamma=1/2.2 approximation use elsewhere in libpng.
  * The sRGB to linear table is exact (to the nearest 16-bit linear fraction).
  * The inverse (linear to sRGB) table has accuracies as follows:

Modified: branches/stable/source/src/libs/libpng/libpng-src/png.h
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/png.h	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/png.h	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,7 +1,7 @@
 
 /* png.h - header file for PNG reference library
  *
- * libpng version 1.6.29, March 16, 2017
+ * libpng version 1.6.34, September 29, 2017
  *
  * Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
@@ -12,7 +12,7 @@
  * Authors and maintainers:
  *   libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat
  *   libpng versions 0.89, June 1996, through 0.96, May 1997: Andreas Dilger
- *   libpng versions 0.97, January 1998, through 1.6.29, March 16, 2017:
+ *   libpng versions 0.97, January 1998, through 1.6.34, September 29, 2017:
  *     Glenn Randers-Pehrson.
  *   See also "Contributing Authors", below.
  */
@@ -25,7 +25,7 @@
  *
  * This code is released under the libpng license.
  *
- * libpng versions 1.0.7, July 1, 2000 through 1.6.29, March 16, 2017 are
+ * libpng versions 1.0.7, July 1, 2000 through 1.6.34, September 29, 2017 are
  * Copyright (c) 2000-2002, 2004, 2006-2017 Glenn Randers-Pehrson, are
  * derived from libpng-1.0.6, and are distributed according to the same
  * disclaimer and license as libpng-1.0.6 with the following individuals
@@ -209,11 +209,11 @@
  *    ...
  *    1.0.19                  10    10019  10.so.0.19[.0]
  *    ...
- *    1.2.57                  13    10257  12.so.0.57[.0]
+ *    1.2.59                  13    10257  12.so.0.59[.0]
  *    ...
- *    1.5.28                  15    10527  15.so.15.28[.0]
+ *    1.5.30                  15    10527  15.so.15.30[.0]
  *    ...
- *    1.6.29                  16    10629  16.so.16.29[.0]
+ *    1.6.34                  16    10633  16.so.16.34[.0]
  *
  *    Henceforth the source version will match the shared-library major
  *    and minor numbers; the shared-library major version number will be
@@ -234,7 +234,7 @@
  *
  * See libpng.txt or libpng.3 for more information.  The PNG specification
  * is available as a W3C Recommendation and as an ISO Specification,
- * <http://www.w3.org/TR/2003/REC-PNG-20031110/
+ * <https://www.w3.org/TR/2003/REC-PNG-20031110/
  */
 
 /*
@@ -241,13 +241,13 @@
  * Y2K compliance in libpng:
  * =========================
  *
- *    March 16, 2017
+ *    September 29, 2017
  *
  *    Since the PNG Development group is an ad-hoc body, we can't make
  *    an official declaration.
  *
  *    This is your unofficial assurance that libpng from version 0.71 and
- *    upward through 1.6.29 are Y2K compliant.  It is my belief that
+ *    upward through 1.6.34 are Y2K compliant.  It is my belief that
  *    earlier versions were also Y2K compliant.
  *
  *    Libpng only has two year fields.  One is a 2-byte unsigned integer
@@ -309,8 +309,8 @@
  */
 
 /* Version information for png.h - this should match the version in png.c */
-#define PNG_LIBPNG_VER_STRING "1.6.29"
-#define PNG_HEADER_VERSION_STRING " libpng version 1.6.29 - March 16, 2017\n"
+#define PNG_LIBPNG_VER_STRING "1.6.34"
+#define PNG_HEADER_VERSION_STRING " libpng version 1.6.34 - September 29, 2017\n"
 
 #define PNG_LIBPNG_VER_SONUM   16
 #define PNG_LIBPNG_VER_DLLNUM  16
@@ -318,7 +318,7 @@
 /* These should match the first 3 components of PNG_LIBPNG_VER_STRING: */
 #define PNG_LIBPNG_VER_MAJOR   1
 #define PNG_LIBPNG_VER_MINOR   6
-#define PNG_LIBPNG_VER_RELEASE 29
+#define PNG_LIBPNG_VER_RELEASE 34
 
 /* This should match the numeric part of the final component of
  * PNG_LIBPNG_VER_STRING, omitting any leading zero:
@@ -349,7 +349,7 @@
  * version 1.0.0 was mis-numbered 100 instead of 10000).  From
  * version 1.0.1 it's    xxyyzz, where x=major, y=minor, z=release
  */
-#define PNG_LIBPNG_VER 10629 /* 1.6.29 */
+#define PNG_LIBPNG_VER 10634 /* 1.6.34 */
 
 /* Library configuration: these options cannot be changed after
  * the library has been built.
@@ -459,7 +459,7 @@
 /* This triggers a compiler error in png.c, if png.c and png.h
  * do not agree upon the version number.
  */
-typedef char* png_libpng_version_1_6_29;
+typedef char* png_libpng_version_1_6_34;
 
 /* Basic control structions.  Read libpng-manual.txt or libpng.3 for more info.
  *
@@ -776,6 +776,7 @@
 #define PNG_INFO_sPLT 0x2000U  /* ESR, 1.0.6 */
 #define PNG_INFO_sCAL 0x4000U  /* ESR, 1.0.6 */
 #define PNG_INFO_IDAT 0x8000U  /* ESR, 1.0.6 */
+#define PNG_INFO_eXIf 0x10000U /* GR-P, 1.6.31 */
 
 /* This is used for the transformation routines, as some of them
  * change these values for the row.  It also should enable using
@@ -1788,7 +1789,8 @@
 #define PNG_FREE_PLTE 0x1000U
 #define PNG_FREE_TRNS 0x2000U
 #define PNG_FREE_TEXT 0x4000U
-#define PNG_FREE_ALL  0x7fffU
+#define PNG_FREE_EXIF 0x8000U /* Added at libpng-1.6.31 */
+#define PNG_FREE_ALL  0xffffU
 #define PNG_FREE_MUL  0x4220U /* PNG_FREE_SPLT|PNG_FREE_TEXT|PNG_FREE_UNKN */
 
 #ifdef PNG_USER_MEM_SUPPORTED
@@ -2007,6 +2009,18 @@
     png_fixed_point int_blue_Z))
 #endif
 
+#ifdef PNG_eXIf_SUPPORTED
+PNG_EXPORT(246, png_uint_32, png_get_eXIf, (png_const_structrp png_ptr,
+    png_inforp info_ptr, png_bytep *exif));
+PNG_EXPORT(247, void, png_set_eXIf, (png_const_structrp png_ptr,
+    png_inforp info_ptr, const png_bytep exif));
+
+PNG_EXPORT(248, png_uint_32, png_get_eXIf_1, (png_const_structrp png_ptr,
+    png_const_inforp info_ptr, png_uint_32 *num_exif, png_bytep *exif));
+PNG_EXPORT(249, void, png_set_eXIf_1, (png_const_structrp png_ptr,
+    png_inforp info_ptr, const png_uint_32 num_exif, const png_bytep exif));
+#endif
+
 #ifdef PNG_gAMA_SUPPORTED
 PNG_FP_EXPORT(137, png_uint_32, png_get_gAMA, (png_const_structrp png_ptr,
     png_const_inforp info_ptr, double *file_gamma))
@@ -2025,9 +2039,6 @@
 #ifdef PNG_hIST_SUPPORTED
 PNG_EXPORT(141, png_uint_32, png_get_hIST, (png_const_structrp png_ptr,
     png_inforp info_ptr, png_uint_16p *hist));
-#endif
-
-#ifdef PNG_hIST_SUPPORTED
 PNG_EXPORT(142, void, png_set_hIST, (png_const_structrp png_ptr,
     png_inforp info_ptr, png_const_uint_16p hist));
 #endif
@@ -2753,7 +2764,7 @@
  *
  * When the simplified API needs to convert between sRGB and linear colorspaces,
  * the actual sRGB transfer curve defined in the sRGB specification (see the
- * article at http://en.wikipedia.org/wiki/SRGB) is used, not the gamma=1/2.2
+ * article at https://en.wikipedia.org/wiki/SRGB) is used, not the gamma=1/2.2
  * approximation used elsewhere in libpng.
  *
  * When an alpha channel is present it is expected to denote pixel coverage
@@ -2808,6 +2819,8 @@
 #  define PNG_FORMAT_FLAG_AFIRST 0x20U /* alpha channel comes first */
 #endif
 
+#define PNG_FORMAT_FLAG_ASSOCIATED_ALPHA 0x40U /* alpha channel is associated */
+
 /* Commonly used formats have predefined macros.
  *
  * First the single byte (sRGB) formats:
@@ -3253,7 +3266,7 @@
  * one to use is one more than this.)
  */
 #ifdef PNG_EXPORT_LAST_ORDINAL
-  PNG_EXPORT_LAST_ORDINAL(245);
+  PNG_EXPORT_LAST_ORDINAL(249);
 #endif
 
 #ifdef __cplusplus

Modified: branches/stable/source/src/libs/libpng/libpng-src/pngconf.h
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/pngconf.h	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/pngconf.h	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,7 +1,7 @@
 
 /* pngconf.h - machine configurable file for libpng
  *
- * libpng version 1.6.29, March 16, 2017
+ * libpng version 1.6.34, September 29, 2017
  *
  * Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)

Modified: branches/stable/source/src/libs/libpng/libpng-src/pngerror.c
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/pngerror.c	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/pngerror.c	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,8 +1,8 @@
 
 /* pngerror.c - stub functions for i/o and memory allocation
  *
- * Last changed in libpng 1.6.26 [October 20, 2016]
- * Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson
+ * Last changed in libpng 1.6.31 [July 27, 2017]
+ * Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
  * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
  *
@@ -163,7 +163,7 @@
          case PNG_NUMBER_FORMAT_02u:
             /* Expects at least 2 digits. */
             mincount = 2;
-            /* FALL THROUGH */
+            /* FALLTHROUGH */
 
          case PNG_NUMBER_FORMAT_u:
             *--end = digits[number % 10];
@@ -173,7 +173,7 @@
          case PNG_NUMBER_FORMAT_02x:
             /* This format expects at least two digits */
             mincount = 2;
-            /* FALL THROUGH */
+            /* FALLTHROUGH */
 
          case PNG_NUMBER_FORMAT_x:
             *--end = digits[number & 0xf];

Modified: branches/stable/source/src/libs/libpng/libpng-src/pngget.c
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/pngget.c	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/pngget.c	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,8 +1,8 @@
 
 /* pngget.c - retrieval of values from info struct
  *
- * Last changed in libpng 1.6.26 [October 20, 2016]
- * Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson
+ * Last changed in libpng 1.6.32 [August 24, 2017]
+ * Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
  * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
  *
@@ -773,6 +773,35 @@
 }
 #endif
 
+#ifdef PNG_eXIf_SUPPORTED
+png_uint_32 PNGAPI
+png_get_eXIf(png_const_structrp png_ptr, png_inforp info_ptr,
+    png_bytep *exif)
+{
+  png_warning(png_ptr, "png_get_eXIf does not work; use png_get_eXIf_1");
+  PNG_UNUSED(info_ptr)
+  PNG_UNUSED(exif)
+  return 0;
+}
+
+png_uint_32 PNGAPI
+png_get_eXIf_1(png_const_structrp png_ptr, png_const_inforp info_ptr,
+    png_uint_32 *num_exif, png_bytep *exif)
+{
+   png_debug1(1, "in %s retrieval function", "eXIf");
+
+   if (png_ptr != NULL && info_ptr != NULL &&
+       (info_ptr->valid & PNG_INFO_eXIf) != 0 && exif != NULL)
+   {
+      *num_exif = info_ptr->num_exif;
+      *exif = info_ptr->exif;
+      return (PNG_INFO_eXIf);
+   }
+
+   return (0);
+}
+#endif
+
 #ifdef PNG_hIST_SUPPORTED
 png_uint_32 PNGAPI
 png_get_hIST(png_const_structrp png_ptr, png_inforp info_ptr,

Modified: branches/stable/source/src/libs/libpng/libpng-src/pnginfo.h
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/pnginfo.h	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/pnginfo.h	2017-11-01 18:15:56 UTC (rev 780)
@@ -185,6 +185,14 @@
    png_byte phys_unit_type; /* resolution type (see PNG_RESOLUTION_ below) */
 #endif
 
+#ifdef PNG_eXIf_SUPPORTED
+   int num_exif;  /* Added at libpng-1.6.31 */
+   png_bytep exif;
+# ifdef PNG_READ_eXIf_SUPPORTED
+   png_bytep eXIf_buf;  /* Added at libpng-1.6.32 */
+# endif
+#endif
+
 #ifdef PNG_hIST_SUPPORTED
    /* The hIST chunk contains the relative frequency or importance of the
     * various palette entries, so that a viewer can intelligently select a

Modified: branches/stable/source/src/libs/libpng/libpng-src/pnglibconf.h
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/pnglibconf.h	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/pnglibconf.h	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,10 +1,10 @@
-/* libpng 1.6.29 STANDARD API DEFINITION */
+/* libpng 1.6.34 STANDARD API DEFINITION */
 
 /* pnglibconf.h - library build configuration */
 
-/* Libpng version 1.6.29 - March 16, 2017 */
+/* Libpng version 1.6.34 - September 29, 2017 */
 
-/* Copyright (c) 1998-2015 Glenn Randers-Pehrson */
+/* Copyright (c) 1998-2017 Glenn Randers-Pehrson */
 
 /* This code is released under the libpng license. */
 /* For conditions of distribution and use, see the disclaimer */
@@ -84,6 +84,7 @@
 #define PNG_READ_USER_TRANSFORM_SUPPORTED
 #define PNG_READ_bKGD_SUPPORTED
 #define PNG_READ_cHRM_SUPPORTED
+#define PNG_READ_eXIf_SUPPORTED
 #define PNG_READ_gAMA_SUPPORTED
 #define PNG_READ_hIST_SUPPORTED
 #define PNG_READ_iCCP_SUPPORTED
@@ -153,6 +154,7 @@
 #define PNG_WRITE_WEIGHTED_FILTER_SUPPORTED
 #define PNG_WRITE_bKGD_SUPPORTED
 #define PNG_WRITE_cHRM_SUPPORTED
+#define PNG_WRITE_eXIf_SUPPORTED
 #define PNG_WRITE_gAMA_SUPPORTED
 #define PNG_WRITE_hIST_SUPPORTED
 #define PNG_WRITE_iCCP_SUPPORTED
@@ -170,6 +172,7 @@
 #define PNG_WRITE_zTXt_SUPPORTED
 #define PNG_bKGD_SUPPORTED
 #define PNG_cHRM_SUPPORTED
+#define PNG_eXIf_SUPPORTED
 #define PNG_gAMA_SUPPORTED
 #define PNG_hIST_SUPPORTED
 #define PNG_iCCP_SUPPORTED

Modified: branches/stable/source/src/libs/libpng/libpng-src/pngpread.c
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/pngpread.c	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/pngpread.c	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,8 +1,8 @@
 
 /* pngpread.c - read a png file in push mode
  *
- * Last changed in libpng 1.6.24 [August 4, 2016]
- * Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson
+ * Last changed in libpng 1.6.32 [August 24, 2017]
+ * Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
  * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
  *
@@ -189,6 +189,7 @@
       png_crc_read(png_ptr, chunk_tag, 4);
       png_ptr->chunk_name = PNG_CHUNK_FROM_STRING(chunk_tag);
       png_check_chunk_name(png_ptr, png_ptr->chunk_name);
+      png_check_chunk_length(png_ptr, png_ptr->push_length);
       png_ptr->mode |= PNG_HAVE_CHUNK_HEADER;
    }
 

Modified: branches/stable/source/src/libs/libpng/libpng-src/pngpriv.h
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/pngpriv.h	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/pngpriv.h	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,7 +1,7 @@
 
 /* pngpriv.h - private declarations for use inside libpng
  *
- * Last changed in libpng 1.6.29 [March 16, 2017]
+ * Last changed in libpng 1.6.32 [August 24, 2017]
  * Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
  * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
@@ -35,7 +35,9 @@
  * Windows/Visual Studio) there is no effect; the OS specific tests below are
  * still required (as of 2011-05-02.)
  */
-#define _POSIX_SOURCE 1 /* Just the POSIX 1003.1 and C89 APIs */
+#ifndef _POSIX_SOURCE
+# define _POSIX_SOURCE 1 /* Just the POSIX 1003.1 and C89 APIs */
+#endif
 
 #ifndef PNG_VERSION_INFO_ONLY
 /* Standard library headers not required by png.h: */
@@ -452,6 +454,21 @@
 #  define png_fixed_error(s1,s2) png_err(s1)
 #endif
 
+/* Some fixed point APIs are still required even if not exported because
+ * they get used by the corresponding floating point APIs.  This magic
+ * deals with this:
+ */
+#ifdef PNG_FIXED_POINT_SUPPORTED
+#  define PNGFAPI PNGAPI
+#else
+#  define PNGFAPI /* PRIVATE */
+#endif
+
+#ifndef PNG_VERSION_INFO_ONLY
+/* Other defines specific to compilers can go here.  Try to keep
+ * them inside an appropriate ifdef/endif pair for portability.
+ */
+
 /* C allows up-casts from (void*) to any pointer and (const void*) to any
  * pointer to a const object.  C++ regards this as a type error and requires an
  * explicit, static, cast and provides the static_cast<> rune to ensure that
@@ -466,25 +483,20 @@
    static_cast<type>(static_cast<const void*>(value))
 #else
 #  define png_voidcast(type, value) (value)
-#  define png_constcast(type, value) ((type)(value))
+#  ifdef _WIN64
+#     ifdef __GNUC__
+         typedef unsigned long long png_ptruint;
+#     else
+         typedef unsigned __int64 png_ptruint;
+#     endif
+#  else
+      typedef unsigned long png_ptruint;
+#  endif
+#  define png_constcast(type, value) ((type)(png_ptruint)(const void*)(value))
 #  define png_aligncast(type, value) ((void*)(value))
 #  define png_aligncastconst(type, value) ((const void*)(value))
 #endif /* __cplusplus */
 
-/* Some fixed point APIs are still required even if not exported because
- * they get used by the corresponding floating point APIs.  This magic
- * deals with this:
- */
-#ifdef PNG_FIXED_POINT_SUPPORTED
-#  define PNGFAPI PNGAPI
-#else
-#  define PNGFAPI /* PRIVATE */
-#endif
-
-#ifndef PNG_VERSION_INFO_ONLY
-/* Other defines specific to compilers can go here.  Try to keep
- * them inside an appropriate ifdef/endif pair for portability.
- */
 #if defined(PNG_FLOATING_POINT_SUPPORTED) ||\
     defined(PNG_FLOATING_ARITHMETIC_SUPPORTED)
    /* png.c requires the following ANSI-C constants if the conversion of
@@ -830,6 +842,7 @@
 #define png_PLTE PNG_U32( 80,  76,  84,  69)
 #define png_bKGD PNG_U32( 98,  75,  71,  68)
 #define png_cHRM PNG_U32( 99,  72,  82,  77)
+#define png_eXIf PNG_U32(101,  88,  73, 102) /* registered July 2017 */
 #define png_fRAc PNG_U32(102,  82,  65,  99) /* registered, not defined */
 #define png_gAMA PNG_U32(103,  65,  77,  65)
 #define png_gIFg PNG_U32(103,  73,  70, 103)
@@ -1130,6 +1143,11 @@
     int intent),PNG_EMPTY);
 #endif
 
+#ifdef PNG_WRITE_eXIf_SUPPORTED
+PNG_INTERNAL_FUNCTION(void,png_write_eXIf,(png_structrp png_ptr,
+    png_bytep exif, int num_exif),PNG_EMPTY);
+#endif
+
 #ifdef PNG_WRITE_iCCP_SUPPORTED
 PNG_INTERNAL_FUNCTION(void,png_write_iCCP,(png_structrp png_ptr,
    png_const_charp name, png_const_bytep profile), PNG_EMPTY);
@@ -1429,6 +1447,11 @@
     png_inforp info_ptr, png_uint_32 length),PNG_EMPTY);
 #endif
 
+#ifdef PNG_READ_eXIf_SUPPORTED
+PNG_INTERNAL_FUNCTION(void,png_handle_eXIf,(png_structrp png_ptr,
+    png_inforp info_ptr, png_uint_32 length),PNG_EMPTY);
+#endif
+
 #ifdef PNG_READ_gAMA_SUPPORTED
 PNG_INTERNAL_FUNCTION(void,png_handle_gAMA,(png_structrp png_ptr,
     png_inforp info_ptr, png_uint_32 length),PNG_EMPTY);
@@ -1504,9 +1527,12 @@
     png_inforp info_ptr, png_uint_32 length),PNG_EMPTY);
 #endif
 
-PNG_INTERNAL_FUNCTION(void,png_check_chunk_name,(png_structrp png_ptr,
-    png_uint_32 chunk_name),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_check_chunk_name,(png_const_structrp png_ptr,
+    const png_uint_32 chunk_name),PNG_EMPTY);
 
+PNG_INTERNAL_FUNCTION(void,png_check_chunk_length,(png_const_structrp png_ptr,
+    const png_uint_32 chunk_length),PNG_EMPTY);
+
 PNG_INTERNAL_FUNCTION(void,png_handle_unknown,(png_structrp png_ptr,
     png_inforp info_ptr, png_uint_32 length, int keep),PNG_EMPTY);
    /* This is the function that gets called for unknown chunks.  The 'keep'

Modified: branches/stable/source/src/libs/libpng/libpng-src/pngread.c
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/pngread.c	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/pngread.c	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,8 +1,8 @@
 
 /* pngread.c - read a PNG file
  *
- * Last changed in libpng 1.6.26 [October 20, 2016]
- * Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson
+ * Last changed in libpng 1.6.33 [September 28, 2017]
+ * Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
  * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
  *
@@ -175,6 +175,11 @@
          png_handle_cHRM(png_ptr, info_ptr, length);
 #endif
 
+#ifdef PNG_READ_eXIf_SUPPORTED
+      else if (chunk_name == png_eXIf)
+         png_handle_eXIf(png_ptr, info_ptr, length);
+#endif
+
 #ifdef PNG_READ_gAMA_SUPPORTED
       else if (chunk_name == png_gAMA)
          png_handle_gAMA(png_ptr, info_ptr, length);
@@ -534,6 +539,7 @@
       png_error(png_ptr, "Invalid attempt to read row data");
 
    /* Fill the row with IDAT data: */
+   png_ptr->row_buf[0]=255; /* to force error if no data was found */
    png_read_IDAT_data(png_ptr, png_ptr->row_buf, row_info.rowbytes + 1);
 
    if (png_ptr->row_buf[0] > PNG_FILTER_VALUE_NONE)
@@ -842,6 +848,11 @@
          png_handle_cHRM(png_ptr, info_ptr, length);
 #endif
 
+#ifdef PNG_READ_eXIf_SUPPORTED
+      else if (chunk_name == png_eXIf)
+         png_handle_eXIf(png_ptr, info_ptr, length);
+#endif
+
 #ifdef PNG_READ_gAMA_SUPPORTED
       else if (chunk_name == png_gAMA)
          png_handle_gAMA(png_ptr, info_ptr, length);
@@ -1883,7 +1894,7 @@
          {
             case 4:
                entry[afirst ? 0 : 3] = (png_uint_16)alpha;
-               /* FALL THROUGH */
+               /* FALLTHROUGH */
 
             case 3:
                if (alpha < 65535)
@@ -1905,7 +1916,7 @@
 
             case 2:
                entry[1 ^ afirst] = (png_uint_16)alpha;
-               /* FALL THROUGH */
+               /* FALLTHROUGH */
 
             case 1:
                if (alpha < 65535)
@@ -1934,6 +1945,7 @@
          {
             case 4:
                entry[afirst ? 0 : 3] = (png_byte)alpha;
+               /* FALLTHROUGH */
             case 3:
                entry[afirst + (2 ^ bgr)] = (png_byte)blue;
                entry[afirst + 1] = (png_byte)green;
@@ -1942,6 +1954,7 @@
 
             case 2:
                entry[1 ^ afirst] = (png_byte)alpha;
+               /* FALLTHROUGH */
             case 1:
                entry[afirst] = (png_byte)green;
                break;
@@ -2861,7 +2874,7 @@
       case P_sRGB:
          /* Change to 8-bit sRGB */
          png_set_alpha_mode_fixed(png_ptr, PNG_ALPHA_PNG, PNG_GAMMA_sRGB);
-         /* FALL THROUGH */
+         /* FALLTHROUGH */
 
       case P_FILE:
          if (png_ptr->bit_depth > 8)
@@ -3179,8 +3192,7 @@
             image->colormap_entries == 244 /* 216 + 1 + 27 */)
             break;
 
-         /* goto bad_output; */
-         /* FALL THROUGH */
+         goto bad_output;
 
       default:
       bad_output:
@@ -3747,7 +3759,13 @@
          mode = PNG_ALPHA_PNG;
          output_gamma = PNG_DEFAULT_sRGB;
       }
-
+      
+      if ((change & PNG_FORMAT_FLAG_ASSOCIATED_ALPHA) != 0)
+      {
+         mode = PNG_ALPHA_OPTIMIZED;
+         change &= ~PNG_FORMAT_FLAG_ASSOCIATED_ALPHA;
+      }
+      
       /* If 'do_local_background' is set check for the presence of gamma
        * correction; this is part of the work-round for the libpng bug
        * described above.
@@ -3973,6 +3991,10 @@
       else if (do_local_compose != 0) /* internal error */
          png_error(png_ptr, "png_image_read: alpha channel lost");
 
+      if ((format & PNG_FORMAT_FLAG_ASSOCIATED_ALPHA) != 0) {
+         info_format |= PNG_FORMAT_FLAG_ASSOCIATED_ALPHA;
+      }
+
       if (info_ptr->bit_depth == 16)
          info_format |= PNG_FORMAT_FLAG_LINEAR;
 

Modified: branches/stable/source/src/libs/libpng/libpng-src/pngrtran.c
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/pngrtran.c	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/pngrtran.c	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,7 +1,7 @@
 
 /* pngrtran.c - transforms the data in a row for PNG readers
  *
- * Last changed in libpng 1.6.29 [March 16, 2017]
+ * Last changed in libpng 1.6.33 [September 28, 2017]
  * Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
  * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
@@ -49,6 +49,7 @@
       case PNG_CRC_WARN_DISCARD:    /* Not a valid action for critical data */
          png_warning(png_ptr,
              "Can't discard critical data on CRC error");
+         /* FALLTHROUGH */
       case PNG_CRC_ERROR_QUIT:                                /* Error/quit */
 
       case PNG_CRC_DEFAULT:
@@ -429,7 +430,7 @@
       int i;
 
       png_ptr->quantize_index = (png_bytep)png_malloc(png_ptr,
-          (png_uint_32)((png_uint_32)num_palette * (sizeof (png_byte))));
+          (png_alloc_size_t)((png_uint_32)num_palette * (sizeof (png_byte))));
       for (i = 0; i < num_palette; i++)
          png_ptr->quantize_index[i] = (png_byte)i;
    }
@@ -446,7 +447,7 @@
 
          /* Initialize an array to sort colors */
          png_ptr->quantize_sort = (png_bytep)png_malloc(png_ptr,
-             (png_uint_32)((png_uint_32)num_palette * (sizeof (png_byte))));
+             (png_alloc_size_t)((png_uint_32)num_palette * (sizeof (png_byte))));
 
          /* Initialize the quantize_sort array */
          for (i = 0; i < num_palette; i++)
@@ -580,9 +581,11 @@
 
          /* Initialize palette index arrays */
          png_ptr->index_to_palette = (png_bytep)png_malloc(png_ptr,
-             (png_uint_32)((png_uint_32)num_palette * (sizeof (png_byte))));
+             (png_alloc_size_t)((png_uint_32)num_palette *
+             (sizeof (png_byte))));
          png_ptr->palette_to_index = (png_bytep)png_malloc(png_ptr,
-             (png_uint_32)((png_uint_32)num_palette * (sizeof (png_byte))));
+             (png_alloc_size_t)((png_uint_32)num_palette *
+             (sizeof (png_byte))));
 
          /* Initialize the sort array */
          for (i = 0; i < num_palette; i++)
@@ -591,7 +594,7 @@
             png_ptr->palette_to_index[i] = (png_byte)i;
          }
 
-         hash = (png_dsortpp)png_calloc(png_ptr, (png_uint_32)(769 *
+         hash = (png_dsortpp)png_calloc(png_ptr, (png_alloc_size_t)(769 *
              (sizeof (png_dsortp))));
 
          num_new_palette = num_palette;
@@ -622,7 +625,7 @@
                   {
 
                      t = (png_dsortp)png_malloc_warn(png_ptr,
-                         (png_uint_32)(sizeof (png_dsort)));
+                         (png_alloc_size_t)(sizeof (png_dsort)));
 
                      if (t == NULL)
                          break;
@@ -747,9 +750,9 @@
       png_size_t num_entries = ((png_size_t)1 << total_bits);
 
       png_ptr->palette_lookup = (png_bytep)png_calloc(png_ptr,
-          (png_uint_32)(num_entries * (sizeof (png_byte))));
+          (png_alloc_size_t)(num_entries * (sizeof (png_byte))));
 
-      distance = (png_bytep)png_malloc(png_ptr, (png_uint_32)(num_entries *
+      distance = (png_bytep)png_malloc(png_ptr, (png_alloc_size_t)(num_entries *
           (sizeof (png_byte))));
 
       memset(distance, 0xff, num_entries * (sizeof (png_byte)));
@@ -1253,7 +1256,7 @@
             default:
 
             case 8:
-               /* FALL THROUGH (Already 8 bits) */
+               /* FALLTHROUGH */ /*  (Already 8 bits) */
 
             case 16:
                /* Already a full 16 bits */
@@ -2934,7 +2937,7 @@
  * using the equation given in Poynton's ColorFAQ of 1998-01-04 at
  * <http://www.inforamp.net/~poynton/>  (THIS LINK IS DEAD June 2008 but
  * versions dated 1998 through November 2002 have been archived at
- * http://web.archive.org/web/20000816232553/http://www.inforamp.net/
+ * https://web.archive.org/web/20000816232553/www.inforamp.net/
  * ~poynton/notes/colour_and_gamma/ColorFAQ.txt )
  * Charles Poynton poynton at poynton.com
  *
@@ -3321,7 +3324,7 @@
                             == png_ptr->trans_color.gray)
                         {
                            unsigned int tmp = *sp & (0x0f0f >> (4 - shift));
-                           tmp |= 
+                           tmp |=
                               (unsigned int)(png_ptr->background.gray << shift);
                            *sp = (png_byte)(tmp & 0xff);
                         }
@@ -4601,7 +4604,9 @@
       png_byte *sp = row + row_info->rowbytes; /* source, last byte + 1 */
       png_byte *dp = sp + row_info->rowbytes;  /* destination, end + 1 */
       while (dp > sp)
-         dp[-2] = dp[-1] = *--sp, dp -= 2;
+      {
+         dp[-2] = dp[-1] = *--sp; dp -= 2;
+      }
 
       row_info->rowbytes *= 2;
       row_info->bit_depth = 16;

Modified: branches/stable/source/src/libs/libpng/libpng-src/pngrutil.c
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/pngrutil.c	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/pngrutil.c	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,7 +1,7 @@
 
 /* pngrutil.c - utilities to read a PNG file
  *
- * Last changed in libpng 1.6.29 [March 16, 2017]
+ * Last changed in libpng 1.6.33 [September 28, 2017]
  * Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
  * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
@@ -181,6 +181,9 @@
    /* Check to see if chunk name is valid. */
    png_check_chunk_name(png_ptr, png_ptr->chunk_name);
 
+   /* Check for too-large chunk length */
+   png_check_chunk_length(png_ptr, length);
+
 #ifdef PNG_IO_STATE_SUPPORTED
    png_ptr->io_state = PNG_IO_READING | PNG_IO_CHUNK_DATA;
 #endif
@@ -311,6 +314,7 @@
 
       if (buffer != NULL)
       {
+         memset(buffer, 0, new_size); /* just in case */
          png_ptr->read_buffer = buffer;
          png_ptr->read_buffer_size = new_size;
       }
@@ -670,6 +674,8 @@
 
                if (text != NULL)
                {
+                  memset(text, 0, buffer_size);
+
                   ret = png_inflate(png_ptr, png_ptr->chunk_name, 1/*finish*/,
                       png_ptr->read_buffer + prefix_size, &lzsize,
                       text + prefix_size, newlength);
@@ -733,9 +739,7 @@
             {
                /* inflateReset failed, store the error message */
                png_zstream_error(png_ptr, ret);
-
-               if (ret == Z_STREAM_END)
-                  ret = PNG_UNEXPECTED_ZLIB_RETURN;
+               ret = PNG_UNEXPECTED_ZLIB_RETURN;
             }
          }
 
@@ -1377,11 +1381,13 @@
     * chunk is just ignored, so does not invalidate the color space.  An
     * alternative is to set the 'invalid' flags at the start of this routine
     * and only clear them in they were not set before and all the tests pass.
-    * The minimum 'deflate' stream is assumed to be just the 2 byte header and
-    * 4 byte checksum.  The keyword must be at least one character and there is
-    * a terminator (0) byte and the compression method.
     */
-   if (length < 9)
+
+   /* The keyword must be at least one character and there is a
+    * terminator (0) byte and the compression method byte, and the
+    * 'zlib' datastream is at least 11 bytes.
+    */
+   if (length < 14)
    {
       png_crc_finish(png_ptr, length);
       png_chunk_benign_error(png_ptr, "too short");
@@ -1413,6 +1419,16 @@
       png_crc_read(png_ptr, (png_bytep)keyword, read_length);
       length -= read_length;
 
+      /* The minimum 'zlib' stream is assumed to be just the 2 byte header,
+       * 5 bytes minimum 'deflate' stream, and the 4 byte checksum.
+       */
+      if (length < 11)
+      {
+         png_crc_finish(png_ptr, length);
+         png_chunk_benign_error(png_ptr, "too short");
+         return;
+      }
+
       keyword_length = 0;
       while (keyword_length < 80 && keyword_length < read_length &&
          keyword[keyword_length] != 0)
@@ -1431,7 +1447,7 @@
 
             if (png_inflate_claim(png_ptr, png_iCCP) == Z_OK)
             {
-               Byte profile_header[132];
+               Byte profile_header[132]={0};
                Byte local_buffer[PNG_INFLATE_BUF_SIZE];
                png_alloc_size_t size = (sizeof profile_header);
 
@@ -1461,7 +1477,7 @@
                         /* Now read the tag table; a variable size buffer is
                          * needed at this point, allocate one for the whole
                          * profile.  The header check has already validated
-                         * that none of these stuff will overflow.
+                         * that none of this stuff will overflow.
                          */
                         const png_uint_32 tag_count = png_get_uint_32(
                             profile_header+128);
@@ -1568,19 +1584,11 @@
                                        return;
                                     }
                                  }
-
-                                 else if (size > 0)
-                                    errmsg = "truncated";
-
-#ifndef __COVERITY__
-                                 else
+                                 if (errmsg == NULL)
                                     errmsg = png_ptr->zstream.msg;
-#endif
                               }
-
                               /* else png_icc_check_tag_table output an error */
                            }
-
                            else /* profile truncated */
                               errmsg = png_ptr->zstream.msg;
                         }
@@ -2009,6 +2017,69 @@
 }
 #endif
 
+#ifdef PNG_READ_eXIf_SUPPORTED
+void /* PRIVATE */
+png_handle_eXIf(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
+{
+   unsigned int i;
+
+   png_debug(1, "in png_handle_eXIf");
+
+   if ((png_ptr->mode & PNG_HAVE_IHDR) == 0)
+      png_chunk_error(png_ptr, "missing IHDR");
+
+   if (length < 2)
+   {
+      png_crc_finish(png_ptr, length);
+      png_chunk_benign_error(png_ptr, "too short");
+      return;
+   }
+
+   else if (info_ptr == NULL || (info_ptr->valid & PNG_INFO_eXIf) != 0)
+   {
+      png_crc_finish(png_ptr, length);
+      png_chunk_benign_error(png_ptr, "duplicate");
+      return;
+   }
+
+   info_ptr->free_me |= PNG_FREE_EXIF;
+
+   info_ptr->eXIf_buf = png_voidcast(png_bytep,
+             png_malloc_warn(png_ptr, length));
+
+   if (info_ptr->eXIf_buf == NULL)
+   {
+      png_crc_finish(png_ptr, length);
+      png_chunk_benign_error(png_ptr, "out of memory");
+      return;
+   }
+
+   for (i = 0; i < length; i++)
+   {
+      png_byte buf[1];
+      png_crc_read(png_ptr, buf, 1);
+      info_ptr->eXIf_buf[i] = buf[0];
+      if (i == 1 && buf[0] != 'M' && buf[0] != 'I'
+                 && info_ptr->eXIf_buf[0] != buf[0])
+      {
+         png_crc_finish(png_ptr, length);
+         png_chunk_benign_error(png_ptr, "incorrect byte-order specifier");
+         png_free(png_ptr, info_ptr->eXIf_buf);
+         info_ptr->eXIf_buf = NULL;
+         return;
+      }
+   }
+
+   if (png_crc_finish(png_ptr, 0) != 0)
+      return;
+
+   png_set_eXIf_1(png_ptr, info_ptr, length, info_ptr->eXIf_buf);
+
+   png_free(png_ptr, info_ptr->eXIf_buf);
+   info_ptr->eXIf_buf = NULL;
+}
+#endif
+
 #ifdef PNG_READ_hIST_SUPPORTED
 void /* PRIVATE */
 png_handle_hIST(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
@@ -2537,6 +2608,9 @@
    if ((png_ptr->mode & PNG_HAVE_IDAT) != 0)
       png_ptr->mode |= PNG_AFTER_IDAT;
 
+   /* Note, "length" is sufficient here; we won't be adding
+    * a null terminator later.
+    */
    buffer = png_read_buffer(png_ptr, length, 2/*silent*/);
 
    if (buffer == NULL)
@@ -2583,23 +2657,28 @@
       {
          png_text text;
 
-         /* It worked; png_ptr->read_buffer now looks like a tEXt chunk except
-          * for the extra compression type byte and the fact that it isn't
-          * necessarily '\0' terminated.
-          */
-         buffer = png_ptr->read_buffer;
-         buffer[uncompressed_length+(keyword_length+2)] = 0;
+         if (png_ptr->read_buffer == NULL)
+           errmsg="Read failure in png_handle_zTXt";
+         else
+         {
+            /* It worked; png_ptr->read_buffer now looks like a tEXt chunk
+             * except for the extra compression type byte and the fact that
+             * it isn't necessarily '\0' terminated.
+             */
+            buffer = png_ptr->read_buffer;
+            buffer[uncompressed_length+(keyword_length+2)] = 0;
 
-         text.compression = PNG_TEXT_COMPRESSION_zTXt;
-         text.key = (png_charp)buffer;
-         text.text = (png_charp)(buffer + keyword_length+2);
-         text.text_length = uncompressed_length;
-         text.itxt_length = 0;
-         text.lang = NULL;
-         text.lang_key = NULL;
+            text.compression = PNG_TEXT_COMPRESSION_zTXt;
+            text.key = (png_charp)buffer;
+            text.text = (png_charp)(buffer + keyword_length+2);
+            text.text_length = uncompressed_length;
+            text.itxt_length = 0;
+            text.lang = NULL;
+            text.lang_key = NULL;
 
-         if (png_set_text_2(png_ptr, info_ptr, &text, 1) != 0)
-            errmsg = "insufficient memory";
+            if (png_set_text_2(png_ptr, info_ptr, &text, 1) != 0)
+               errmsg = "insufficient memory";
+         }
       }
 
       else
@@ -2975,7 +3054,7 @@
          case 2:
             png_ptr->user_chunk_cache_max = 1;
             png_chunk_benign_error(png_ptr, "no space in chunk cache");
-            /* FALL THROUGH */
+            /* FALLTHROUGH */
          case 1:
             /* NOTE: prior to 1.6.0 this case resulted in an unknown critical
              * chunk being skipped, now there will be a hard error below.
@@ -2984,7 +3063,7 @@
 
          default: /* not at limit */
             --(png_ptr->user_chunk_cache_max);
-            /* FALL THROUGH */
+            /* FALLTHROUGH */
          case 0: /* no limit */
 #  endif /* USER_LIMITS */
             /* Here when the limit isn't reached or when limits are compiled
@@ -3035,23 +3114,61 @@
  */
 
 void /* PRIVATE */
-png_check_chunk_name(png_structrp png_ptr, png_uint_32 chunk_name)
+png_check_chunk_name(png_const_structrp png_ptr, const png_uint_32 chunk_name)
 {
    int i;
+   png_uint_32 cn=chunk_name;
 
    png_debug(1, "in png_check_chunk_name");
 
    for (i=1; i<=4; ++i)
    {
-      int c = chunk_name & 0xff;
+      int c = cn & 0xff;
 
       if (c < 65 || c > 122 || (c > 90 && c < 97))
          png_chunk_error(png_ptr, "invalid chunk type");
 
-      chunk_name >>= 8;
+      cn >>= 8;
    }
 }
 
+void /* PRIVATE */
+png_check_chunk_length(png_const_structrp png_ptr, const png_uint_32 length)
+{
+   png_alloc_size_t limit = PNG_UINT_31_MAX;
+
+# ifdef PNG_SET_USER_LIMITS_SUPPORTED
+   if (png_ptr->user_chunk_malloc_max > 0 &&
+       png_ptr->user_chunk_malloc_max < limit)
+      limit = png_ptr->user_chunk_malloc_max;
+# elif PNG_USER_CHUNK_MALLOC_MAX > 0
+   if (PNG_USER_CHUNK_MALLOC_MAX < limit)
+      limit = PNG_USER_CHUNK_MALLOC_MAX;
+# endif
+   if (png_ptr->chunk_name == png_IDAT)
+   {
+      png_alloc_size_t idat_limit = PNG_UINT_31_MAX;
+      size_t row_factor =
+         (png_ptr->width * png_ptr->channels * (png_ptr->bit_depth > 8? 2: 1)
+          + 1 + (png_ptr->interlaced? 6: 0));
+      if (png_ptr->height > PNG_UINT_32_MAX/row_factor)
+         idat_limit=PNG_UINT_31_MAX;
+      else
+         idat_limit = png_ptr->height * row_factor;
+      row_factor = row_factor > 32566? 32566 : row_factor;
+      idat_limit += 6 + 5*(idat_limit/row_factor+1); /* zlib+deflate overhead */
+      idat_limit=idat_limit < PNG_UINT_31_MAX? idat_limit : PNG_UINT_31_MAX;
+      limit = limit < idat_limit? idat_limit : limit;
+   }
+
+   if (length > limit)
+   {
+      png_debug2(0," length = %lu, limit = %lu",
+         (unsigned long)length,(unsigned long)limit);
+      png_chunk_error(png_ptr, "chunk data is too large");
+   }
+}
+
 /* Combines the row recently read in with the existing pixels in the row.  This
  * routine takes care of alpha and transparency if requested.  This routine also
  * handles the two methods of progressive display of interlaced images,
@@ -3377,7 +3494,7 @@
                 */
                do
                {
-                  dp[0] = sp[0], dp[1] = sp[1];
+                  dp[0] = sp[0]; dp[1] = sp[1];
 
                   if (row_width <= bytes_to_jump)
                      return;
@@ -3398,7 +3515,7 @@
                 */
                for (;;)
                {
-                  dp[0] = sp[0], dp[1] = sp[1], dp[2] = sp[2];
+                  dp[0] = sp[0]; dp[1] = sp[1]; dp[2] = sp[2];
 
                   if (row_width <= bytes_to_jump)
                      return;
@@ -3887,7 +4004,10 @@
       /* Find the best predictor, the least of pa, pb, pc favoring the earlier
        * ones in the case of a tie.
        */
-      if (pb < pa) pa = pb, a = b;
+      if (pb < pa)
+      {
+         pa = pb; a = b;
+      }
       if (pc < pa) a = c;
 
       /* Calculate the current pixel in a, and move the previous row pixel to c
@@ -3939,7 +4059,10 @@
       pc = (p + pc) < 0 ? -(p + pc) : p + pc;
 #endif
 
-      if (pb < pa) pa = pb, a = b;
+      if (pb < pa)
+      {
+         pa = pb; a = b;
+      }
       if (pc < pa) a = c;
 
       a += *row;

Modified: branches/stable/source/src/libs/libpng/libpng-src/pngset.c
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/pngset.c	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/pngset.c	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,8 +1,8 @@
 
 /* pngset.c - storage of image information into info struct
  *
- * Last changed in libpng 1.6.26 [October 20, 2016]
- * Copyright (c) 1998-2016 Glenn Randers-Pehrson
+ * Last changed in libpng 1.6.32 [August 24, 2017]
+ * Copyright (c) 1998-2017 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
  * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
  *
@@ -134,6 +134,53 @@
 
 #endif /* cHRM */
 
+#ifdef PNG_eXIf_SUPPORTED
+void PNGAPI
+png_set_eXIf(png_const_structrp png_ptr, png_inforp info_ptr,
+    const png_bytep eXIf_buf)
+{
+  png_warning(png_ptr, "png_set_eXIf does not work; use png_set_eXIf_1");
+  PNG_UNUSED(info_ptr)
+  PNG_UNUSED(eXIf_buf)
+}
+
+void PNGAPI
+png_set_eXIf_1(png_const_structrp png_ptr, png_inforp info_ptr,
+    const png_uint_32 num_exif, const png_bytep eXIf_buf)
+{
+   int i;
+
+   png_debug1(1, "in %s storage function", "eXIf");
+
+   if (png_ptr == NULL || info_ptr == NULL)
+      return;
+
+   if (info_ptr->exif)
+   {
+      png_free(png_ptr, info_ptr->exif);
+      info_ptr->exif = NULL;
+   }
+
+   info_ptr->num_exif = num_exif;
+
+   info_ptr->exif = png_voidcast(png_bytep, png_malloc_warn(png_ptr,
+       info_ptr->num_exif));
+
+   if (info_ptr->exif == NULL)
+   {
+      png_warning(png_ptr, "Insufficient memory for eXIf chunk data");
+      return;
+   }
+
+   info_ptr->free_me |= PNG_FREE_EXIF;
+
+   for (i = 0; i < (int) info_ptr->num_exif; i++)
+      info_ptr->exif[i] = eXIf_buf[i];
+
+   info_ptr->valid |= PNG_INFO_eXIf;
+}
+#endif /* eXIf */
+
 #ifdef PNG_gAMA_SUPPORTED
 void PNGFAPI
 png_set_gAMA_fixed(png_const_structrp png_ptr, png_inforp info_ptr,
@@ -1102,8 +1149,9 @@
       info_ptr->valid |= PNG_INFO_sPLT;
       ++(info_ptr->splt_palettes_num);
       ++np;
+      ++entries;
    }
-   while (++entries, --nentries);
+   while (--nentries);
 
    if (nentries > 0)
       png_chunk_report(png_ptr, "sPLT out of memory", PNG_CHUNK_WRITE_ERROR);
@@ -1354,6 +1402,7 @@
       static PNG_CONST png_byte chunks_to_ignore[] = {
          98,  75,  71,  68, '\0',  /* bKGD */
          99,  72,  82,  77, '\0',  /* cHRM */
+        101,  88,  73, 102, '\0',  /* eXIf */
         103,  65,  77,  65, '\0',  /* gAMA */
         104,  73,  83,  84, '\0',  /* hIST */
         105,  67,  67,  80, '\0',  /* iCCP */
@@ -1696,7 +1745,9 @@
       png_byte ch = (png_byte)*key++;
 
       if ((ch > 32 && ch <= 126) || (ch >= 161 /*&& ch <= 255*/))
-         *new_key++ = ch, ++key_len, space = 0;
+      {
+         *new_key++ = ch; ++key_len; space = 0;
+      }
 
       else if (space == 0)
       {
@@ -1703,7 +1754,7 @@
          /* A space or an invalid character when one wasn't seen immediately
           * before; output just a space.
           */
-         *new_key++ = 32, ++key_len, space = 1;
+         *new_key++ = 32; ++key_len; space = 1;
 
          /* If the character was not a space then it is invalid. */
          if (ch != 32)
@@ -1716,7 +1767,7 @@
 
    if (key_len > 0 && space != 0) /* trailing space */
    {
-      --key_len, --new_key;
+      --key_len; --new_key;
       if (bad_character == 0)
          bad_character = 32;
    }

Modified: branches/stable/source/src/libs/libpng/libpng-src/pngstruct.h
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/pngstruct.h	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/pngstruct.h	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,7 +1,7 @@
 
 /* pngstruct.h - header file for PNG reference library
  *
- * Last changed in libpng 1.6.28 [January 5, 2017]
+ * Last changed in libpng 1.6.32 [August 24, 2017]
  * Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
  * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)

Modified: branches/stable/source/src/libs/libpng/libpng-src/pngtest.c
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/pngtest.c	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/pngtest.c	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,8 +1,8 @@
 
 /* pngtest.c - a simple test program to test libpng
  *
- * Last changed in libpng 1.6.26 [October 20, 2016]
- * Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson
+ * Last changed in libpng 1.6.32 [August 24, 2017]
+ * Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
  * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
  *
@@ -144,6 +144,7 @@
 static int verbose = 0;
 static int strict = 0;
 static int relaxed = 0;
+static int xfail = 0;
 static int unsupported_chunks = 0; /* chunk unsupported by libpng in input */
 static int error_count = 0; /* count calls to png_error */
 static int warning_count = 0; /* count calls to png_warning */
@@ -463,7 +464,7 @@
    if (test != NULL && test->file_name != NULL)
       name = test->file_name;
 
-   fprintf(STDERR, "%s: libpng warning: %s\n", name, message);
+   fprintf(STDERR, "\n%s: libpng warning: %s\n", name, message);
 }
 
 /* This is the default error handling function.  Note that replacements for
@@ -936,8 +937,12 @@
       fprintf(STDERR, "%s -> %s: libpng read error\n", inname, outname);
       png_free(read_ptr, row_buf);
       row_buf = NULL;
+      if (verbose != 0)
+        fprintf(STDERR, "   destroy read structs\n");
       png_destroy_read_struct(&read_ptr, &read_info_ptr, &end_info_ptr);
 #ifdef PNG_WRITE_SUPPORTED
+      if (verbose != 0)
+        fprintf(STDERR, "   destroy write structs\n");
       png_destroy_info_struct(write_ptr, &write_end_info_ptr);
       png_destroy_write_struct(&write_ptr, &write_info_ptr);
 #endif
@@ -952,11 +957,13 @@
    if (setjmp(png_jmpbuf(write_ptr)))
    {
       fprintf(STDERR, "%s -> %s: libpng write error\n", inname, outname);
+      if (verbose != 0)
+        fprintf(STDERR, "   destroying read structs\n");
       png_destroy_read_struct(&read_ptr, &read_info_ptr, &end_info_ptr);
+      if (verbose != 0)
+        fprintf(STDERR, "   destroying write structs\n");
       png_destroy_info_struct(write_ptr, &write_end_info_ptr);
-#ifdef PNG_WRITE_SUPPORTED
       png_destroy_write_struct(&write_ptr, &write_info_ptr);
-#endif
       FCLOSE(fpin);
       FCLOSE(fpout);
       return (1);
@@ -1192,6 +1199,22 @@
       }
    }
 #endif
+#ifdef PNG_READ_eXIf_SUPPORTED
+   {
+      png_bytep exif=NULL;
+      png_uint_32 exif_length;
+
+      if (png_get_eXIf_1(read_ptr, read_info_ptr, &exif_length, &exif) != 0)
+      {
+         if (exif_length > 1)
+            fprintf(STDERR," eXIf type %c%c, %lu bytes\n",exif[0],exif[1],
+               (unsigned long)exif_length);
+# ifdef PNG_WRITE_eXIf_SUPPORTED
+         png_set_eXIf_1(write_ptr, write_info_ptr, exif_length, exif);
+# endif
+      }
+   }
+#endif
 #ifdef PNG_hIST_SUPPORTED
    {
       png_uint_16p hist;
@@ -1302,10 +1325,10 @@
          {
             int i;
 
-            printf("\n");
+            fprintf(STDERR,"\n");
             for (i=0; i<num_text; i++)
             {
-               printf("   Text compression[%d]=%d\n",
+               fprintf(STDERR,"   Text compression[%d]=%d\n",
                    i, text_ptr[i].compression);
             }
          }
@@ -1398,6 +1421,10 @@
 
    write_chunks(write_ptr, before_IDAT); /* after PLTE */
 
+   png_write_info(write_ptr, write_end_info_ptr);
+
+   write_chunks(write_ptr, after_IDAT); /* after IDAT */
+
 #ifdef PNG_COMPRESSION_COMPAT
    /* Test the 'compatibility' setting here, if it is available. */
    png_set_compression(write_ptr, PNG_COMPRESSION_COMPAT);
@@ -1518,10 +1545,10 @@
          {
             int i;
 
-            printf("\n");
+            fprintf(STDERR,"\n");
             for (i=0; i<num_text; i++)
             {
-               printf("   Text compression[%d]=%d\n",
+               fprintf(STDERR,"   Text compression[%d]=%d\n",
                    i, text_ptr[i].compression);
             }
          }
@@ -1530,6 +1557,22 @@
       }
    }
 #endif
+#ifdef PNG_READ_eXIf_SUPPORTED
+   {
+      png_bytep exif=NULL;
+      png_uint_32 exif_length;
+
+      if (png_get_eXIf_1(read_ptr, end_info_ptr, &exif_length, &exif) != 0)
+      {
+         if (exif_length > 1)
+            fprintf(STDERR," eXIf type %c%c, %lu bytes\n",exif[0],exif[1],
+               (unsigned long)exif_length);
+# ifdef PNG_WRITE_eXIf_SUPPORTED
+         png_set_eXIf_1(write_ptr, write_end_info_ptr, exif_length, exif);
+# endif
+      }
+   }
+#endif
 #ifdef PNG_tIME_SUPPORTED
    {
       png_timep mod_time;
@@ -1845,6 +1888,7 @@
          inname = argv[2];
          strict++;
          relaxed = 0;
+         multiple=1;
       }
 
       else if (strcmp(argv[1], "--relaxed") == 0)
@@ -1854,7 +1898,18 @@
          inname = argv[2];
          strict = 0;
          relaxed++;
+         multiple=1;
       }
+      else if (strcmp(argv[1], "--xfail") == 0)
+      {
+         status_dots_requested = 0;
+         verbose = 1;
+         inname = argv[2];
+         strict = 0;
+         xfail++;
+         relaxed++;
+         multiple=1;
+      }
 
       else
       {
@@ -1911,8 +1966,13 @@
 
          else
          {
-            fprintf(STDERR, " FAIL\n");
-            ierror += kerror;
+            if (xfail)
+              fprintf(STDERR, " XFAIL\n");
+            else
+            {
+              fprintf(STDERR, " FAIL\n");
+              ierror += kerror;
+            }
          }
 #if defined(PNG_USER_MEM_SUPPORTED) && PNG_DEBUG
          if (allocation_now != current_allocation)
@@ -2000,8 +2060,13 @@
 #endif
             }
 
-            fprintf(STDERR, " FAIL\n");
-            ierror += kerror;
+            if (xfail)
+              fprintf(STDERR, " XFAIL\n");
+            else
+            {
+              fprintf(STDERR, " FAIL\n");
+              ierror += kerror;
+            }
          }
 #if defined(PNG_USER_MEM_SUPPORTED) && PNG_DEBUG
          if (allocation_now != current_allocation)
@@ -2088,4 +2153,4 @@
 #endif
 
 /* Generate a compiler error if there is an old png.h in the search path. */
-typedef png_libpng_version_1_6_29 Your_png_h_is_not_version_1_6_29;
+typedef png_libpng_version_1_6_34 Your_png_h_is_not_version_1_6_34;

Modified: branches/stable/source/src/libs/libpng/libpng-src/pngtest.png
===================================================================
(Binary files differ)

Modified: branches/stable/source/src/libs/libpng/libpng-src/pngtrans.c
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/pngtrans.c	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/pngtrans.c	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,8 +1,8 @@
 
 /* pngtrans.c - transforms the data in a row (used by both readers and writers)
  *
- * Last changed in libpng 1.6.26 [October 20, 2016]
- * Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson
+ * Last changed in libpng 1.6.33 [September 28, 2017]
+ * Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
  * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
  *
@@ -514,11 +514,15 @@
          if (at_start != 0) /* Skip initial filler */
             ++sp;
          else          /* Skip initial channel and, for sp, the filler */
-            sp += 2, ++dp;
+         {
+            sp += 2; ++dp;
+         }
 
          /* For a 1 pixel wide image there is nothing to do */
          while (sp < ep)
-            *dp++ = *sp, sp += 2;
+         {
+            *dp++ = *sp; sp += 2;
+         }
 
          row_info->pixel_depth = 8;
       }
@@ -528,10 +532,14 @@
          if (at_start != 0) /* Skip initial filler */
             sp += 2;
          else          /* Skip initial channel and, for sp, the filler */
-            sp += 4, dp += 2;
+         {
+            sp += 4; dp += 2;
+         }
 
          while (sp < ep)
-            *dp++ = *sp++, *dp++ = *sp, sp += 3;
+         {
+            *dp++ = *sp++; *dp++ = *sp; sp += 3;
+         }
 
          row_info->pixel_depth = 16;
       }
@@ -554,11 +562,15 @@
          if (at_start != 0) /* Skip initial filler */
             ++sp;
          else          /* Skip initial channels and, for sp, the filler */
-            sp += 4, dp += 3;
+         {
+            sp += 4; dp += 3;
+         }
 
          /* Note that the loop adds 3 to dp and 4 to sp each time. */
          while (sp < ep)
-            *dp++ = *sp++, *dp++ = *sp++, *dp++ = *sp, sp += 2;
+         {
+            *dp++ = *sp++; *dp++ = *sp++; *dp++ = *sp; sp += 2;
+         }
 
          row_info->pixel_depth = 24;
       }
@@ -568,14 +580,16 @@
          if (at_start != 0) /* Skip initial filler */
             sp += 2;
          else          /* Skip initial channels and, for sp, the filler */
-            sp += 8, dp += 6;
+         {
+            sp += 8; dp += 6;
+         }
 
          while (sp < ep)
          {
             /* Copy 6 bytes, skip 2 */
-            *dp++ = *sp++, *dp++ = *sp++;
-            *dp++ = *sp++, *dp++ = *sp++;
-            *dp++ = *sp++, *dp++ = *sp, sp += 3;
+            *dp++ = *sp++; *dp++ = *sp++;
+            *dp++ = *sp++; *dp++ = *sp++;
+            *dp++ = *sp++; *dp++ = *sp; sp += 3;
          }
 
          row_info->pixel_depth = 48;
@@ -595,7 +609,7 @@
       return; /* The filler channel has gone already */
 
    /* Fix the rowbytes value. */
-   row_info->rowbytes = (unsigned int)(dp-row);
+   row_info->rowbytes = (png_size_t)(dp-row);
 }
 #endif
 
@@ -694,7 +708,7 @@
        * forms produced on either GCC or MSVC.
        */
       int padding = PNG_PADBITS(row_info->pixel_depth, row_info->width);
-      png_bytep rp = png_ptr->row_buf + row_info->rowbytes;
+      png_bytep rp = png_ptr->row_buf + row_info->rowbytes - 1;
 
       switch (row_info->bit_depth)
       {

Modified: branches/stable/source/src/libs/libpng/libpng-src/pngwrite.c
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/pngwrite.c	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/pngwrite.c	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,8 +1,8 @@
 
 /* pngwrite.c - general routines to write a PNG file
  *
- * Last changed in libpng 1.6.26 [October 20, 2016]
- * Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson
+ * Last changed in libpng 1.6.32 [August 24, 2017]
+ * Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
  * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
  *
@@ -237,6 +237,11 @@
       png_write_bKGD(png_ptr, &(info_ptr->background), info_ptr->color_type);
 #endif
 
+#ifdef PNG_WRITE_eXIf_SUPPORTED
+   if ((info_ptr->valid & PNG_INFO_eXIf) != 0)
+      png_write_eXIf(png_ptr, info_ptr->exif, info_ptr->num_exif);
+#endif
+
 #ifdef PNG_WRITE_hIST_SUPPORTED
    if ((info_ptr->valid & PNG_INFO_hIST) != 0)
       png_write_hIST(png_ptr, info_ptr->hist, info_ptr->num_palette);
@@ -432,6 +437,12 @@
          }
       }
 #endif
+
+#ifdef PNG_WRITE_eXIf_SUPPORTED
+   if ((info_ptr->valid & PNG_INFO_eXIf) != 0)
+      png_write_eXIf(png_ptr, info_ptr->exif, info_ptr->num_exif);
+#endif
+
 #ifdef PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED
       write_unknown_chunks(png_ptr, info_ptr, PNG_AFTER_IDAT);
 #endif
@@ -1007,8 +1018,8 @@
          case 5:
          case 6:
          case 7: png_app_error(png_ptr, "Unknown row filter for method 0");
-            /* FALL THROUGH */
 #endif /* WRITE_FILTER */
+            /* FALLTHROUGH */
          case PNG_FILTER_VALUE_NONE:
             png_ptr->do_filter = PNG_FILTER_NONE; break;
 
@@ -1875,7 +1886,7 @@
                tRNS[i] = entry[afirst ? 0 : 3];
                if (tRNS[i] < 255)
                   num_trans = i+1;
-               /* FALL THROUGH */
+               /* FALLTHROUGH */
             case 3:
                palette[i].blue = entry[afirst + (2 ^ bgr)];
                palette[i].green = entry[afirst + 1];
@@ -1886,7 +1897,7 @@
                tRNS[i] = entry[1 ^ afirst];
                if (tRNS[i] < 255)
                   num_trans = i+1;
-               /* FALL THROUGH */
+               /* FALLTHROUGH */
             case 1:
                palette[i].blue = palette[i].red = palette[i].green =
                   entry[afirst];
@@ -1929,7 +1940,7 @@
    int colormap = (format & PNG_FORMAT_FLAG_COLORMAP);
    int linear = !colormap && (format & PNG_FORMAT_FLAG_LINEAR); /* input */
    int alpha = !colormap && (format & PNG_FORMAT_FLAG_ALPHA);
-   int write_16bit = linear && !colormap && (display->convert_to_8bit == 0);
+   int write_16bit = linear && (display->convert_to_8bit == 0);
 
 #   ifdef PNG_BENIGN_ERRORS_SUPPORTED
       /* Make sure we error out on any bad situation */

Modified: branches/stable/source/src/libs/libpng/libpng-src/pngwutil.c
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/pngwutil.c	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/pngwutil.c	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,8 +1,8 @@
 
 /* pngwutil.c - utilities to write a PNG file
  *
- * Last changed in libpng 1.6.26 [October 20, 2016]
- * Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson
+ * Last changed in libpng 1.6.32 [August 24, 2017]
+ * Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
  * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
  *
@@ -1003,7 +1003,8 @@
                optimize_cmf(data, png_image_size(png_ptr));
 #endif
 
-         png_write_complete_chunk(png_ptr, png_IDAT, data, size);
+         if (size > 0)
+            png_write_complete_chunk(png_ptr, png_IDAT, data, size);
          png_ptr->mode |= PNG_HAVE_IDAT;
 
          png_ptr->zstream.next_out = data;
@@ -1049,7 +1050,8 @@
             optimize_cmf(data, png_image_size(png_ptr));
 #endif
 
-         png_write_complete_chunk(png_ptr, png_IDAT, data, size);
+         if (size > 0)
+            png_write_complete_chunk(png_ptr, png_IDAT, data, size);
          png_ptr->zstream.avail_out = 0;
          png_ptr->zstream.next_out = NULL;
          png_ptr->mode |= PNG_HAVE_IDAT | PNG_AFTER_IDAT;
@@ -1471,6 +1473,28 @@
 }
 #endif
 
+#ifdef PNG_WRITE_eXIf_SUPPORTED
+/* Write the Exif data */
+void /* PRIVATE */
+png_write_eXIf(png_structrp png_ptr, png_bytep exif, int num_exif)
+{
+   int i;
+   png_byte buf[1];
+
+   png_debug(1, "in png_write_eXIf");
+
+   png_write_chunk_header(png_ptr, png_eXIf, (png_uint_32)(num_exif));
+
+   for (i = 0; i < num_exif; i++)
+   {
+      buf[0] = exif[i];
+      png_write_chunk_data(png_ptr, buf, (png_size_t)1);
+   }
+
+   png_write_chunk_end(png_ptr);
+}
+#endif
+
 #ifdef PNG_WRITE_hIST_SUPPORTED
 /* Write the histogram */
 void /* PRIVATE */

Modified: branches/stable/source/src/libs/libpng/libpng-src/projects/owatcom/pngconfig.mak
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/projects/owatcom/pngconfig.mak	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/projects/owatcom/pngconfig.mak	2017-11-01 18:15:56 UTC (rev 780)
@@ -126,7 +126,7 @@
 $# awk.)  You can find source code and a built executable (called awk95.exe)
 $# here:
 $#
-$#     http://www.cs.princeton.edu/~bwk/btl.mirror/
+$#     https://www.cs.princeton.edu/~bwk/btl.mirror/
 $#
 $# The executable works just fine.
 $#

Modified: branches/stable/source/src/libs/libpng/libpng-src/projects/vstudio/README.txt
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/projects/vstudio/README.txt	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/projects/vstudio/README.txt	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,7 +1,7 @@
 
 VisualStudio instructions
 
-libpng version 1.6.29 - March 16, 2017
+libpng version 1.6.34 - September 29, 2017
 
 Copyright (c) 2010,2013,2015 Glenn Randers-Pehrson
 

Modified: branches/stable/source/src/libs/libpng/libpng-src/projects/vstudio/zlib.props
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/projects/vstudio/zlib.props	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/projects/vstudio/zlib.props	2017-11-01 18:15:56 UTC (rev 780)
@@ -2,7 +2,7 @@
 <!--
  * zlib.props - location of zlib source
  *
- * libpng version 1.6.29 - March 16, 2017
+ * libpng version 1.6.34 - September 29, 2017
  *
  * Copyright (c) 1998-2011 Glenn Randers-Pehrson
  *

Modified: branches/stable/source/src/libs/libpng/libpng-src/scripts/README.txt
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/scripts/README.txt	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/scripts/README.txt	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,9 +1,11 @@
 
-Makefiles for  libpng version 1.6.29 - March 16, 2017
+Makefiles for  libpng version 1.6.34 - September 29, 2017
 
 pnglibconf.h.prebuilt       =>  Stores configuration settings
  makefile.linux    =>  Linux/ELF makefile
-                       (gcc, creates libpng16.so.16.1.6.29)
+                       (gcc, creates libpng16.so.16.1.6.34)
+ makefile.linux-opt=>  Linux/ELF makefile with hardware optimizations on
+                       (gcc, creates libpng16.so.16.1.6.34)
  makefile.gcc      =>  Generic makefile (gcc, creates static libpng.a)
  makefile.knr      =>  Archaic UNIX Makefile that converts files with
                        ansi2knr (Requires ansi2knr.c from
@@ -33,12 +35,12 @@
  makefile.os2      =>  OS/2 Makefile (gcc and emx, requires libpng.def)
  makefile.sco      =>  For SCO OSr5  ELF and Unixware 7 with Native cc
  makefile.sggcc    =>  Silicon Graphics (gcc,
-                       creates libpng16.so.16.1.6.29)
+                       creates libpng16.so.16.1.6.34)
  makefile.sgi      =>  Silicon Graphics IRIX makefile (cc, creates static lib)
  makefile.solaris  =>  Solaris 2.X makefile (gcc,
-                       creates libpng16.so.16.1.6.29)
+                       creates libpng16.so.16.1.6.34)
  makefile.so9      =>  Solaris 9 makefile (gcc,
-                       creates libpng16.so.16.1.6.29)
+                       creates libpng16.so.16.1.6.34)
  makefile.std      =>  Generic UNIX makefile (cc, creates static libpng.a)
  makefile.sunos    =>  Sun makefile
  makefile.32sunu   =>  Sun Ultra 32-bit makefile

Modified: branches/stable/source/src/libs/libpng/libpng-src/scripts/def.c
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/scripts/def.c	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/scripts/def.c	2017-11-01 18:15:56 UTC (rev 780)
@@ -21,7 +21,7 @@
 PNG_DFN "OS2 CODE PRELOAD MOVEABLE DISCARDABLE"
 PNG_DFN ""
 PNG_DFN "EXPORTS"
-PNG_DFN ";Version 1.6.29"
+PNG_DFN ";Version 1.6.34"
 
 #define PNG_EXPORTA(ordinal, type, name, args, attributes)\
         PNG_DFN "@" SYMBOL_PREFIX "@@" name "@"

Modified: branches/stable/source/src/libs/libpng/libpng-src/scripts/libpng-config-head.in
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/scripts/libpng-config-head.in	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/scripts/libpng-config-head.in	2017-11-01 18:15:56 UTC (rev 780)
@@ -11,7 +11,7 @@
 
 # Modeled after libxml-config.
 
-version=1.6.29
+version=1.6.34
 prefix=""
 libdir=""
 libs=""

Modified: branches/stable/source/src/libs/libpng/libpng-src/scripts/libpng.pc.in
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/scripts/libpng.pc.in	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/scripts/libpng.pc.in	2017-11-01 18:15:56 UTC (rev 780)
@@ -5,6 +5,6 @@
 
 Name: libpng
 Description: Loads and saves PNG files
-Version: 1.6.29
+Version: 1.6.34
 Libs: -L${libdir} -lpng16
 Cflags: -I${includedir}

Modified: branches/stable/source/src/libs/libpng/libpng-src/scripts/makefile.cegcc
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/scripts/makefile.cegcc	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/scripts/makefile.cegcc	2017-11-01 18:15:56 UTC (rev 780)
@@ -23,7 +23,7 @@
 
 VERMAJ = 1
 VERMIN = 6
-VERMIC = 29
+VERMIC = 34
 VER = $(VERMAJ).$(VERMIN).$(VERMIC)
 NAME = libpng
 PACKAGE = $(NAME)-$(VER)

Modified: branches/stable/source/src/libs/libpng/libpng-src/scripts/makefile.linux
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/scripts/makefile.linux	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/scripts/makefile.linux	2017-11-01 18:15:56 UTC (rev 780)
@@ -10,7 +10,7 @@
 # Library name:
 LIBNAME = libpng16
 PNGMAJ = 16
-RELEASE = 29
+RELEASE = 34
 
 # Shared library names:
 LIBSO=$(LIBNAME).so
@@ -92,7 +92,7 @@
 	$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
 
 .c.pic.o:
-	$(CC) -c $(CFLAGS) -fPIC -o $@ $*.c
+	$(CC) -c $(CPPFLAGS) $(CFLAGS) -fPIC -o $@ $*.c
 
 all: libpng.a $(LIBSO) pngtest pngtest-static libpng.pc libpng-config
 

Added: branches/stable/source/src/libs/libpng/libpng-src/scripts/makefile.linux-opt
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/scripts/makefile.linux-opt	                        (rev 0)
+++ branches/stable/source/src/libs/libpng/libpng-src/scripts/makefile.linux-opt	2017-11-01 18:15:56 UTC (rev 780)
@@ -0,0 +1,265 @@
+# makefile for libpng.a and libpng16.so on Linux ELF with gcc
+# Copyright (C) 1998,1999,2002,2006,2008,2010-2014,2017 Greg Roelofs and
+# Glenn Randers-Pehrson
+# Copyright (C) 1996,1997 Andreas Dilger
+#
+# This code is released under the libpng license.
+# For conditions of distribution and use, see the disclaimer
+# and license in png.h
+
+# Library name:
+LIBNAME = libpng16
+PNGMAJ = 16
+RELEASE = 34
+
+# Shared library names:
+LIBSO=$(LIBNAME).so
+LIBSOMAJ=$(LIBNAME).so.$(PNGMAJ)
+LIBSOREL=$(LIBSOMAJ).$(RELEASE)
+OLDSO=libpng.so
+
+# Utilities:
+AR_RC=ar rc
+CC=gcc
+MKDIR_P=mkdir -p
+LN_SF=ln -sf
+RANLIB=ranlib
+CP=cp
+RM_F=/bin/rm -f
+
+# where "make install" puts libpng16.a, libpng16.so*,
+# libpng16/png.h, libpng16/pngconf.h, and libpng16/pnglibconf.h
+# Prefix must be a full pathname.
+prefix=/usr/local
+exec_prefix=$(prefix)
+
+# Where the zlib library and include files are located.
+#ZLIBLIB=/usr/local/lib
+#ZLIBINC=/usr/local/include
+ZLIBLIB=../zlib
+ZLIBINC=../zlib
+
+ALIGN=
+# for i386:
+#ALIGN=-malign-loops=2 -malign-functions=2
+
+#WARNMORE=-Wwrite-strings -Wpointer-arith \
+#	-Wmissing-declarations -Wtraditional -Wcast-align \
+#	-Wstrict-prototypes -Wmissing-prototypes
+
+# for pgcc version 2.95.1, -O3 is buggy; don't use it.
+
+CPPFLAGS=-I$(ZLIBINC)
+CPPFLAGS += -DPNG_ARM_NEON
+CPPFLAGS += -DPNG_MIPS_MSA
+CPPFLAGS += -DPNG_INTEL_SSE
+CPPFLAGS += -DPNG_POWERPC_VSX
+CPPFLAGS+=-ansi -pedantic -Wextra -Wall -Wshadow -Wno-sign-conversion
+CPPFLAGS+=-W -Wall -Wconversion $(ALIGN)
+# CPPFLAGS+=$(WARNMORE)
+CFLAGS= -O3 -funroll-loops
+
+LDFLAGS=-L. -Wl,-rpath,. -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) -lpng16 -lz -lm
+LDFLAGS_A=-L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) libpng.a -lz -lm
+
+INCPATH=$(prefix)/include
+LIBPATH=$(exec_prefix)/lib
+MANPATH=$(prefix)/man
+BINPATH=$(exec_prefix)/bin
+
+# override DESTDIR= on the make install command line to easily support
+# installing into a temporary location.  Example:
+#
+#    make install DESTDIR=/tmp/build/libpng
+#
+# If you're going to install into a temporary location
+# via DESTDIR, $(DESTDIR)$(prefix) must already exist before
+# you execute make install.
+DESTDIR=
+
+DB=$(DESTDIR)$(BINPATH)
+DI=$(DESTDIR)$(INCPATH)
+DL=$(DESTDIR)$(LIBPATH)
+DM=$(DESTDIR)$(MANPATH)
+
+# Pre-built configuration
+# See scripts/pnglibconf.mak for more options
+PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt
+
+OBJS =  png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
+	pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
+	pngwtran.o pngmem.o pngerror.o pngpread.o \
+	arm/arm_init.o arm/filter_neon_intrinsics.o \
+	mips/mips_init.o mips/filter_msa_intrinsics.o \
+	intel/intel_init.o intel/filter_sse2_intrinsics.o\
+	powerpc/powerpc_init.o powerpc/filter_vsx_intrinsics.o
+
+OBJSDLL = $(OBJS:.o=.pic.o)
+
+.SUFFIXES:      .c .o .pic.o
+
+.c.o:
+	$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
+
+.c.pic.o:
+	$(CC) -c $(CPPFLAGS) $(CFLAGS) -fPIC -o $@ $*.c
+
+all: libpng.a $(LIBSO) pngtest pngtest-static libpng.pc libpng-config
+
+pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
+	$(CP) $(PNGLIBCONF_H_PREBUILT) $@
+
+libpng.a: $(OBJS)
+	$(AR_RC) $@ $(OBJS)
+	$(RANLIB) $@
+
+libpng.pc:
+	cat scripts/libpng.pc.in | sed -e s!@prefix@!$(prefix)! \
+	-e s!@exec_prefix@!$(exec_prefix)! \
+	-e s!@libdir@!$(LIBPATH)! \
+	-e s!@includedir@!$(INCPATH)! \
+	-e s!-lpng16!-lpng16\ -lz\ -lm! > libpng.pc
+
+libpng-config:
+	( cat scripts/libpng-config-head.in; \
+	echo prefix=\"$(prefix)\"; \
+	echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \
+	echo L_opts=\"-L$(LIBPATH)\"; \
+	echo R_opts=\"-Wl,-rpath,$(LIBPATH)\"; \
+	echo libs=\"-lpng16 -lz -lm\"; \
+	cat scripts/libpng-config-body.in ) > libpng-config
+	chmod +x libpng-config
+
+$(LIBSO): $(LIBSOMAJ)
+	$(LN_SF) $(LIBSOMAJ) $(LIBSO)
+
+$(LIBSOMAJ): $(OBJSDLL)
+	$(CC) -shared -Wl,-soname,$(LIBSOMAJ) -o $(LIBSOMAJ) $(OBJSDLL)
+
+pngtest: pngtest.o $(LIBSO)
+	$(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
+
+pngtest-static: pngtest.o libpng.a
+	$(CC) -o pngtest-static $(CFLAGS) pngtest.o $(LDFLAGS_A)
+
+test: pngtest pngtest-static
+	@echo ""
+	@echo "   Running pngtest dynamically linked with $(LIBSO):"
+	@echo ""
+	./pngtest
+	@echo ""
+	@echo "   Running pngtest statically linked with libpng.a:"
+	@echo ""
+	./pngtest-static
+
+install-headers: png.h pngconf.h pnglibconf.h
+	- at if [ ! -d $(DI) ]; then $(MKDIR_P) $(DI); fi
+	- at if [ ! -d $(DI)/$(LIBNAME) ]; then $(MKDIR_P) $(DI)/$(LIBNAME); fi
+	cp png.h pngconf.h pnglibconf.h $(DI)/$(LIBNAME)
+	chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h $(DI)/$(LIBNAME)/pnglibconf.h
+	-@$(RM_F) $(DI)/png.h $(DI)/pngconf.h $(DI)/pnglibconf.h
+	-@$(RM_F) $(DI)/libpng
+	(cd $(DI); $(LN_SF) $(LIBNAME) libpng; $(LN_SF) $(LIBNAME)/* .)
+
+install-static: install-headers libpng.a
+	- at if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
+	cp libpng.a $(DL)/$(LIBNAME).a
+	chmod 644 $(DL)/$(LIBNAME).a
+	-@$(RM_F) $(DL)/libpng.a
+	(cd $(DL); $(LN_SF) $(LIBNAME).a libpng.a)
+
+install-shared: install-headers $(LIBSOMAJ) libpng.pc
+	- at if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
+	-@$(RM_F) $(DL)/$(LIBSO)
+	-@$(RM_F) $(DL)/$(LIBSOREL)
+	-@$(RM_F) $(DL)/$(OLDSO)
+	cp $(LIBSOMAJ) $(DL)/$(LIBSOREL)
+	chmod 755 $(DL)/$(LIBSOREL)
+	(cd $(DL); \
+	$(LN_SF) $(LIBSOREL) $(LIBSO); \
+	$(LN_SF) $(LIBSO) $(OLDSO))
+
+	- at if [ ! -d $(DL)/pkgconfig ]; then $(MKDIR_P) $(DL)/pkgconfig; fi
+	-@$(RM_F) $(DL)/pkgconfig/$(LIBNAME).pc
+	-@$(RM_F) $(DL)/pkgconfig/libpng.pc
+	cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc
+	chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc
+	(cd $(DL)/pkgconfig; $(LN_SF) $(LIBNAME).pc libpng.pc)
+
+install-man: libpng.3 libpngpf.3 png.5
+	- at if [ ! -d $(DM) ]; then $(MKDIR_P) $(DM); fi
+	- at if [ ! -d $(DM)/man3 ]; then $(MKDIR_P) $(DM)/man3; fi
+	-@$(RM_F) $(DM)/man3/libpng.3
+	-@$(RM_F) $(DM)/man3/libpngpf.3
+	cp libpng.3 $(DM)/man3
+	cp libpngpf.3 $(DM)/man3
+	- at if [ ! -d $(DM)/man5 ]; then $(MKDIR_P) $(DM)/man5; fi
+	-@$(RM_F) $(DM)/man5/png.5
+	cp png.5 $(DM)/man5
+
+install-config: libpng-config
+	- at if [ ! -d $(DB) ]; then $(MKDIR_P) $(DB); fi
+	-@$(RM_F) $(DB)/libpng-config
+	-@$(RM_F) $(DB)/$(LIBNAME)-config
+	cp libpng-config $(DB)/$(LIBNAME)-config
+	chmod 755 $(DB)/$(LIBNAME)-config
+	(cd $(DB); $(LN_SF) $(LIBNAME)-config libpng-config)
+
+install: install-static install-shared install-man install-config
+
+# If you installed in $(DESTDIR), test-installed won't work until you
+# move the library to its final location.  Use test-dd to test it
+# before then.
+
+test-dd:
+	echo
+	echo Testing installed dynamic shared library in $(DL).
+	$(CC) -I$(DI) $(CPPFLAGS) \
+	   `$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
+	   -L$(DL) -L$(ZLIBLIB) -Wl, -rpath,$(DL) -Wl,-rpath,$(ZLIBLIB) \
+	   -o pngtestd `$(BINPATH)/$(LIBNAME)-config --ldflags`
+	./pngtestd pngtest.png
+
+test-installed:
+	$(CC) $(CPPFLAGS) \
+	   `$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
+	   -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) \
+	   -o pngtesti `$(BINPATH)/$(LIBNAME)-config --ldflags`
+	./pngtesti pngtest.png
+
+clean:
+	$(RM_F) *.o libpng.a pngtest pngout.png libpng-config \
+	$(LIBSO) $(LIBSOMAJ)* pngtest-static pngtesti \
+	libpng.pc pnglibconf.h
+
+DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
+writelock:
+	chmod a-w *.[ch35] $(DOCS) scripts/*
+
+# DO NOT DELETE THIS LINE -- make depend depends on it.
+
+png.o png.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngerror.o pngerror.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngrio.o pngrio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngwio.o pngwio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngmem.o pngmem.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngset.o pngset.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngget.o pngget.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngread.o pngread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngrtran.o pngrtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngrutil.o pngrutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngtrans.o pngtrans.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngwrite.o pngwrite.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngwtran.o pngwtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngwutil.o pngwutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+pngpread.o pngpread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
+arm/arm_init.o arm/arm_init.o: pngpriv.h
+arm/filter_neon_intrinsics.o arm/filter_neon_intrinsics.pic.o: pngpriv.h
+mips/mips_init.o mips/mips_init.pic.o: pngpriv.h
+mips/filter_msa_intrinsics.o mips/filter_msa_intrinsics.pic.:  pngpriv.h
+intel/intel_init.o intel/intel_init.pic.:  pngpriv.h
+intel/filter_sse2_intrinsics.o intel/filter_sse2_intrinsics.pic.:  pngpriv.h
+powerpc/powerpc_init.o powerpc/powerpc_init.pic.:  pngpriv.h
+powerpc/filter_vsx_intrinsics.o powerpc/filter_vsx_intrinsics.pic.:  pngpriv.h
+
+pngtest.o: png.h pngconf.h pnglibconf.h

Modified: branches/stable/source/src/libs/libpng/libpng-src/scripts/makefile.msys
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/scripts/makefile.msys	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/scripts/makefile.msys	2017-11-01 18:15:56 UTC (rev 780)
@@ -18,7 +18,7 @@
 # Library name:
 LIBNAME = libpng16
 PNGMAJ = 16
-RELEASE = 29
+RELEASE = 34
 
 # Shared library names:
 LIBSO=$(LIBNAME).dll

Modified: branches/stable/source/src/libs/libpng/libpng-src/scripts/makefile.ne12bsd
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/scripts/makefile.ne12bsd	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/scripts/makefile.ne12bsd	2017-11-01 18:15:56 UTC (rev 780)
@@ -17,7 +17,7 @@
 
 LIB=	png16
 SHLIB_MAJOR=	0
-SHLIB_MINOR=	1.6.29
+SHLIB_MINOR=	1.6.34
 SRCS=	png.c pngset.c pngget.c pngrutil.c pngtrans.c pngwutil.c \
 	pngread.c pngrio.c pngwio.c pngwrite.c pngrtran.c \
 	pngwtran.c pngmem.c pngerror.c pngpread.c

Modified: branches/stable/source/src/libs/libpng/libpng-src/scripts/makefile.netbsd
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/scripts/makefile.netbsd	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/scripts/makefile.netbsd	2017-11-01 18:15:56 UTC (rev 780)
@@ -17,7 +17,7 @@
 
 LIB=	png
 SHLIB_MAJOR=	16
-SHLIB_MINOR=	1.6.29
+SHLIB_MINOR=	1.6.34
 SRCS=	png.c pngset.c pngget.c pngrutil.c pngtrans.c pngwutil.c \
 	pngread.c pngrio.c pngwio.c pngwrite.c pngrtran.c \
 	pngwtran.c pngmem.c pngerror.c pngpread.c

Modified: branches/stable/source/src/libs/libpng/libpng-src/scripts/makefile.openbsd
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/scripts/makefile.openbsd	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/scripts/makefile.openbsd	2017-11-01 18:15:56 UTC (rev 780)
@@ -11,7 +11,7 @@
 MANDIR= ${PREFIX}/man/cat
 
 SHLIB_MAJOR=	16
-SHLIB_MINOR=	1.6.29
+SHLIB_MINOR=	1.6.34
 
 LIB=	png
 SRCS=	png.c pngerror.c pngget.c pngmem.c pngpread.c \

Modified: branches/stable/source/src/libs/libpng/libpng-src/scripts/makefile.solaris-x86
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/scripts/makefile.solaris-x86	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/scripts/makefile.solaris-x86	2017-11-01 18:15:56 UTC (rev 780)
@@ -83,7 +83,7 @@
 	$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
 
 .c.pic.o:
-	$(CC) -c $(CFLAGS) -fPIC -o $@ $*.c
+	$(CC) -c $(CPPFLAGS) $(CFLAGS) -fPIC -o $@ $*.c
 
 all: libpng.a $(LIBSO) pngtest libpng.pc libpng-config
 

Modified: branches/stable/source/src/libs/libpng/libpng-src/scripts/pnglibconf.dfa
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/scripts/pnglibconf.dfa	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/scripts/pnglibconf.dfa	2017-11-01 18:15:56 UTC (rev 780)
@@ -8,7 +8,7 @@
 com
 version
 com
-com Copyright (c) 1998-2016 Glenn Randers-Pehrson
+com Copyright (c) 1998-2017 Glenn Randers-Pehrson
 com
 com This code is released under the libpng license.
 com For conditions of distribution and use, see the disclaimer
@@ -741,6 +741,7 @@
 # Ancillary chunks
 chunk bKGD
 chunk cHRM enables COLORSPACE
+chunk eXIf
 chunk gAMA enables GAMMA
 chunk hIST
 chunk iCCP enables COLORSPACE, GAMMA

Modified: branches/stable/source/src/libs/libpng/libpng-src/scripts/pnglibconf.h.prebuilt
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/scripts/pnglibconf.h.prebuilt	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/scripts/pnglibconf.h.prebuilt	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,10 +1,10 @@
-/* libpng 1.6.29 STANDARD API DEFINITION */
+/* libpng 1.6.34 STANDARD API DEFINITION */
 
 /* pnglibconf.h - library build configuration */
 
-/* Libpng version 1.6.29 - March 16, 2017 */
+/* Libpng version 1.6.34 - September 29, 2017 */
 
-/* Copyright (c) 1998-2015 Glenn Randers-Pehrson */
+/* Copyright (c) 1998-2017 Glenn Randers-Pehrson */
 
 /* This code is released under the libpng license. */
 /* For conditions of distribution and use, see the disclaimer */
@@ -84,6 +84,7 @@
 #define PNG_READ_USER_TRANSFORM_SUPPORTED
 #define PNG_READ_bKGD_SUPPORTED
 #define PNG_READ_cHRM_SUPPORTED
+#define PNG_READ_eXIf_SUPPORTED
 #define PNG_READ_gAMA_SUPPORTED
 #define PNG_READ_hIST_SUPPORTED
 #define PNG_READ_iCCP_SUPPORTED
@@ -153,6 +154,7 @@
 #define PNG_WRITE_WEIGHTED_FILTER_SUPPORTED
 #define PNG_WRITE_bKGD_SUPPORTED
 #define PNG_WRITE_cHRM_SUPPORTED
+#define PNG_WRITE_eXIf_SUPPORTED
 #define PNG_WRITE_gAMA_SUPPORTED
 #define PNG_WRITE_hIST_SUPPORTED
 #define PNG_WRITE_iCCP_SUPPORTED
@@ -170,6 +172,7 @@
 #define PNG_WRITE_zTXt_SUPPORTED
 #define PNG_bKGD_SUPPORTED
 #define PNG_cHRM_SUPPORTED
+#define PNG_eXIf_SUPPORTED
 #define PNG_gAMA_SUPPORTED
 #define PNG_hIST_SUPPORTED
 #define PNG_iCCP_SUPPORTED

Modified: branches/stable/source/src/libs/libpng/libpng-src/scripts/symbols.def
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/scripts/symbols.def	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/scripts/symbols.def	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,4 +1,4 @@
-;Version 1.6.29
+;Version 1.6.34
 ;--------------------------------------------------------------
 ; LIBPNG symbol list as a Win32 DEF file
 ; Contains all the symbols that can be exported from libpng
@@ -250,3 +250,7 @@
  png_get_palette_max @243
  png_set_option @244
  png_image_write_to_memory @245
+ png_get_eXIf @246
+ png_set_eXIf @247
+ png_get_eXIf_1 @248
+ png_set_eXIf_1 @249

Deleted: branches/stable/source/src/libs/libpng/libpng-src/tests/badadler.png
===================================================================
(Binary files differ)

Deleted: branches/stable/source/src/libs/libpng/libpng-src/tests/badcrc.png
===================================================================
(Binary files differ)

Modified: branches/stable/source/src/libs/libpng/libpng-src/tests/pngtest
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/tests/pngtest	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/tests/pngtest	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,4 +1,2 @@
 #!/bin/sh
-./pngtest --relaxed ${srcdir}/tests/badcrc.png
-./pngtest --relaxed ${srcdir}/tests/badadler.png
 exec ./pngtest --strict ${srcdir}/pngtest.png

Added: branches/stable/source/src/libs/libpng/libpng-src/tests/pngtest-badpngs
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/tests/pngtest-badpngs	                        (rev 0)
+++ branches/stable/source/src/libs/libpng/libpng-src/tests/pngtest-badpngs	2017-11-01 18:15:56 UTC (rev 780)
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+# various crashers
+# using --relaxed because some come from fuzzers that don't maintain CRC's
+
+./pngtest --relaxed ${srcdir}/contrib/testpngs/crashers/badcrc.png
+./pngtest --relaxed ${srcdir}/contrib/testpngs/crashers/badadler.png
+./pngtest --xfail ${srcdir}/contrib/testpngs/crashers/bad_iCCP.png
+./pngtest --xfail ${srcdir}/contrib/testpngs/crashers/empty_ancillary_chunks.png
+./pngtest --xfail ${srcdir}/contrib/testpngs/crashers/huge_*_chunk.png \
+    ${srcdir}/contrib/testpngs/crashers/huge_*safe_to_copy.png
+
+exec ./pngtest --xfail ${srcdir}/contrib/testpngs/crashers/huge_IDAT.png

Modified: branches/stable/source/src/libs/libpng/libpng-src/tests/pngunknown-sAPI
===================================================================
--- branches/stable/source/src/libs/libpng/libpng-src/tests/pngunknown-sAPI	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/libpng-src/tests/pngunknown-sAPI	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,2 +1,2 @@
 #!/bin/sh
-exec ./pngunknown --strict bKGD=save cHRM=save gAMA=save all=discard iCCP=save sBIT=save sRGB=save "${srcdir}/pngtest.png"
+exec ./pngunknown --strict bKGD=save cHRM=save gAMA=save all=discard iCCP=save sBIT=save sRGB=save eXIf=save "${srcdir}/pngtest.png"

Modified: branches/stable/source/src/libs/libpng/version.ac
===================================================================
--- branches/stable/source/src/libs/libpng/version.ac	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/libpng/version.ac	2017-11-01 18:15:56 UTC (rev 780)
@@ -8,4 +8,4 @@
 dnl --------------------------------------------------------
 dnl
 dnl  m4-include this file to define the current libpng version
-m4_define([libpng_version], [1.6.29])
+m4_define([libpng_version], [1.6.34])

Modified: branches/stable/source/src/libs/poppler/Makefile.in
===================================================================
--- branches/stable/source/src/libs/poppler/Makefile.in	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/poppler/Makefile.in	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.15.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2017 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1169,7 +1169,7 @@
 	  ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
 	|| chmod -R a+r "$(distdir)"
 dist-gzip: distdir
-	tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+	tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz
 	$(am__post_remove_distdir)
 
 dist-bzip2: distdir
@@ -1195,7 +1195,7 @@
 	@echo WARNING: "Support for shar distribution archives is" \
 	               "deprecated." >&2
 	@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
-	shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
+	shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz
 	$(am__post_remove_distdir)
 
 dist-zip: distdir
@@ -1213,7 +1213,7 @@
 distcheck: dist
 	case '$(DIST_ARCHIVES)' in \
 	*.tar.gz*) \
-	  GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
+	  eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\
 	*.tar.bz2*) \
 	  bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
 	*.tar.lz*) \
@@ -1223,7 +1223,7 @@
 	*.tar.Z*) \
 	  uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
 	*.shar.gz*) \
-	  GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
+	  eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\
 	*.zip*) \
 	  unzip $(distdir).zip ;;\
 	esac

Modified: branches/stable/source/src/libs/poppler/aclocal.m4
===================================================================
--- branches/stable/source/src/libs/poppler/aclocal.m4	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/poppler/aclocal.m4	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,6 +1,6 @@
-# generated automatically by aclocal 1.15 -*- Autoconf -*-
+# generated automatically by aclocal 1.15.1 -*- Autoconf -*-
 
-# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+# Copyright (C) 1996-2017 Free Software Foundation, Inc.
 
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -20,7 +20,7 @@
 If you have problems, you may need to regenerate the build system entirely.
 To do so, use the procedure documented by the package, typically 'autoreconf'.])])
 
-# Copyright (C) 2002-2014 Free Software Foundation, Inc.
+# Copyright (C) 2002-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -35,7 +35,7 @@
 [am__api_version='1.15'
 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
 dnl require some minimum version.  Point them to the right macro.
-m4_if([$1], [1.15], [],
+m4_if([$1], [1.15.1], [],
       [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
 ])
 
@@ -51,7 +51,7 @@
 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.15])dnl
+[AM_AUTOMAKE_VERSION([1.15.1])dnl
 m4_ifndef([AC_AUTOCONF_VERSION],
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
@@ -58,7 +58,7 @@
 
 # AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
 
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -110,7 +110,7 @@
 
 # AM_CONDITIONAL                                            -*- Autoconf -*-
 
-# Copyright (C) 1997-2014 Free Software Foundation, Inc.
+# Copyright (C) 1997-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -141,7 +141,7 @@
 Usually this means the macro was only invoked conditionally.]])
 fi])])
 
-# Copyright (C) 1999-2014 Free Software Foundation, Inc.
+# Copyright (C) 1999-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -332,7 +332,7 @@
 
 # Generate code to set up dependency tracking.              -*- Autoconf -*-
 
-# Copyright (C) 1999-2014 Free Software Foundation, Inc.
+# Copyright (C) 1999-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -408,7 +408,7 @@
 
 # Do all the work for Automake.                             -*- Autoconf -*-
 
-# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+# Copyright (C) 1996-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -605,7 +605,7 @@
 done
 echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
 
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -626,7 +626,7 @@
 fi
 AC_SUBST([install_sh])])
 
-# Copyright (C) 2003-2014 Free Software Foundation, Inc.
+# Copyright (C) 2003-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -648,7 +648,7 @@
 # Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
 # From Jim Meyering
 
-# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+# Copyright (C) 1996-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -683,7 +683,7 @@
 
 # Check to see how 'make' treats includes.	            -*- Autoconf -*-
 
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -733,7 +733,7 @@
 
 # Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
 
-# Copyright (C) 1997-2014 Free Software Foundation, Inc.
+# Copyright (C) 1997-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -772,7 +772,7 @@
 
 # Helper functions for option handling.                     -*- Autoconf -*-
 
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -801,7 +801,7 @@
 AC_DEFUN([_AM_IF_OPTION],
 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
 
-# Copyright (C) 1999-2014 Free Software Foundation, Inc.
+# Copyright (C) 1999-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -848,7 +848,7 @@
 # For backward compatibility.
 AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
 
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -867,7 +867,7 @@
 
 # Check to make sure that the build environment is sane.    -*- Autoconf -*-
 
-# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+# Copyright (C) 1996-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -948,7 +948,7 @@
 rm -f conftest.file
 ])
 
-# Copyright (C) 2009-2014 Free Software Foundation, Inc.
+# Copyright (C) 2009-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1008,7 +1008,7 @@
 _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
 ])
 
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1036,7 +1036,7 @@
 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
 AC_SUBST([INSTALL_STRIP_PROGRAM])])
 
-# Copyright (C) 2006-2014 Free Software Foundation, Inc.
+# Copyright (C) 2006-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1055,7 +1055,7 @@
 
 # Check how to create a tarball.                            -*- Autoconf -*-
 
-# Copyright (C) 2004-2014 Free Software Foundation, Inc.
+# Copyright (C) 2004-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,

Modified: branches/stable/source/src/libs/poppler/include/Makefile.in
===================================================================
--- branches/stable/source/src/libs/poppler/include/Makefile.in	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/poppler/include/Makefile.in	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.15.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2017 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,

Modified: branches/stable/source/src/libs/poppler/include/fofi/Makefile.in
===================================================================
--- branches/stable/source/src/libs/poppler/include/fofi/Makefile.in	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/poppler/include/fofi/Makefile.in	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.15.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2017 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,

Modified: branches/stable/source/src/libs/poppler/include/goo/Makefile.in
===================================================================
--- branches/stable/source/src/libs/poppler/include/goo/Makefile.in	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/poppler/include/goo/Makefile.in	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.15.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2017 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,

Modified: branches/stable/source/src/libs/xpdf/ChangeLog
===================================================================
--- branches/stable/source/src/libs/xpdf/ChangeLog	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/ChangeLog	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,3 +1,9 @@
+2017-08-13  Akira Kakuto  <kakuto at fuk.kindai.ac.jp>
+
+	* Import xpdf-4.00.
+	* Makefile.am, version.ac: Adjust.
+	* xpdf-foolabs: Remove.
+
 2017-03-27  Karl Berry  <karl at freefriends.org>
 
 	* Makefile.am (EXTRA_DIST): TLpatches not Tlpatches.

Modified: branches/stable/source/src/libs/xpdf/Makefile.am
===================================================================
--- branches/stable/source/src/libs/xpdf/Makefile.am	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/Makefile.am	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,4 +1,4 @@
-## $Id: Makefile.am 43617 2017-03-27 18:00:45Z karl $
+## $Id: Makefile.am 45031 2017-08-13 07:14:48Z kakuto $
 ## Proxy Makefile.am to build xpdf for TeX Live.
 ##
 ##   Copyright 2016-2017 Karl Berry <tex-live at tug.org>
@@ -112,6 +112,7 @@
 	@XPDF_TREE@/xpdf/Stream.cc \
 	@XPDF_TREE@/xpdf/TextString.cc \
 	@XPDF_TREE@/xpdf/UnicodeMap.cc \
+	@XPDF_TREE@/xpdf/UTF8.cc \
 	@XPDF_TREE@/xpdf/XFAForm.cc \
 	@XPDF_TREE@/xpdf/XRef.cc \
 	@XPDF_TREE@/xpdf/Zoox.cc

Modified: branches/stable/source/src/libs/xpdf/Makefile.in
===================================================================
--- branches/stable/source/src/libs/xpdf/Makefile.in	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/Makefile.in	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.15.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2017 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -160,6 +160,7 @@
 	@XPDF_TREE@/xpdf/Stream.$(OBJEXT) \
 	@XPDF_TREE@/xpdf/TextString.$(OBJEXT) \
 	@XPDF_TREE@/xpdf/UnicodeMap.$(OBJEXT) \
+	@XPDF_TREE@/xpdf/UTF8.$(OBJEXT) \
 	@XPDF_TREE@/xpdf/XFAForm.$(OBJEXT) \
 	@XPDF_TREE@/xpdf/XRef.$(OBJEXT) \
 	@XPDF_TREE@/xpdf/Zoox.$(OBJEXT)
@@ -472,6 +473,7 @@
 	@XPDF_TREE@/xpdf/Stream.cc \
 	@XPDF_TREE@/xpdf/TextString.cc \
 	@XPDF_TREE@/xpdf/UnicodeMap.cc \
+	@XPDF_TREE@/xpdf/UTF8.cc \
 	@XPDF_TREE@/xpdf/XFAForm.cc \
 	@XPDF_TREE@/xpdf/XRef.cc \
 	@XPDF_TREE@/xpdf/Zoox.cc
@@ -677,6 +679,8 @@
 @XPDF_TREE@/xpdf/UnicodeMap.$(OBJEXT):  \
 	@XPDF_TREE@/xpdf/$(am__dirstamp) \
 	@XPDF_TREE@/xpdf/$(DEPDIR)/$(am__dirstamp)
+ at XPDF_TREE@/xpdf/UTF8.$(OBJEXT): @XPDF_TREE@/xpdf/$(am__dirstamp) \
+	@XPDF_TREE@/xpdf/$(DEPDIR)/$(am__dirstamp)
 @XPDF_TREE@/xpdf/XFAForm.$(OBJEXT): @XPDF_TREE@/xpdf/$(am__dirstamp) \
 	@XPDF_TREE@/xpdf/$(DEPDIR)/$(am__dirstamp)
 @XPDF_TREE@/xpdf/XRef.$(OBJEXT): @XPDF_TREE@/xpdf/$(am__dirstamp) \
@@ -747,6 +751,7 @@
 @AMDEP_TRUE@@am__include@ @am__quote@@XPDF_TREE@/xpdf/$(DEPDIR)/SecurityHandler.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@@XPDF_TREE@/xpdf/$(DEPDIR)/Stream.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@@XPDF_TREE@/xpdf/$(DEPDIR)/TextString.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote@@XPDF_TREE@/xpdf/$(DEPDIR)/UTF8.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@@XPDF_TREE@/xpdf/$(DEPDIR)/UnicodeMap.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@@XPDF_TREE@/xpdf/$(DEPDIR)/XFAForm.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@@XPDF_TREE@/xpdf/$(DEPDIR)/XRef.Po at am__quote@
@@ -942,7 +947,7 @@
 	  ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
 	|| chmod -R a+r "$(distdir)"
 dist-gzip: distdir
-	tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+	tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz
 	$(am__post_remove_distdir)
 
 dist-bzip2: distdir
@@ -968,7 +973,7 @@
 	@echo WARNING: "Support for shar distribution archives is" \
 	               "deprecated." >&2
 	@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
-	shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
+	shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz
 	$(am__post_remove_distdir)
 
 dist-zip: distdir
@@ -986,7 +991,7 @@
 distcheck: dist
 	case '$(DIST_ARCHIVES)' in \
 	*.tar.gz*) \
-	  GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
+	  eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\
 	*.tar.bz2*) \
 	  bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
 	*.tar.lz*) \
@@ -996,7 +1001,7 @@
 	*.tar.Z*) \
 	  uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
 	*.shar.gz*) \
-	  GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
+	  eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\
 	*.zip*) \
 	  unzip $(distdir).zip ;;\
 	esac

Modified: branches/stable/source/src/libs/xpdf/TLpatches/ChangeLog
===================================================================
--- branches/stable/source/src/libs/xpdf/TLpatches/ChangeLog	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/TLpatches/ChangeLog	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,3 +1,11 @@
+2017-08-13  Akira Kakuto  <kakuto at fuk.kindai.ac.jp>
+
+	Imported xpdf-4.00 source tree:
+	  http://www.xpdfreader.com/download.html
+	  xpdf-4.00.tar.gz
+	* patch-bunched: Added patch-10, patch-20, patch-22, patch-30,
+	patch-40, and patch-41 by Peter, for simplicity.
+
 2015-05-09  Peter Breitenlohner  <peb at mppmu.mpg.de>
 
 	* patch-41-W32TeX: On Windows use USERPROFILE instead of HOME.

Modified: branches/stable/source/src/libs/xpdf/TLpatches/TL-Changes
===================================================================
--- branches/stable/source/src/libs/xpdf/TLpatches/TL-Changes	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/TLpatches/TL-Changes	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,6 +1,6 @@
-Changes applied to the xpdf-3.04/ tree as obtained from:
-	ftp://ftp.foolabs.com/pub/xpdf/
+Changes applied to the xpdf-4.00/ tree as obtained from:
+	http://www.xpdfreader.com/download.html
 
 Removed:
-	install-sh
-
+	aconf.h.in
+	xpdf-qt/

Deleted: branches/stable/source/src/libs/xpdf/TLpatches/patch-10-exclude-body-of-Page_getDefaultCTM
===================================================================
--- branches/stable/source/src/libs/xpdf/TLpatches/patch-10-exclude-body-of-Page_getDefaultCTM	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/TLpatches/patch-10-exclude-body-of-Page_getDefaultCTM	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,23 +0,0 @@
-	Enable compilation with -DPDF_PARSER_ONLY
-
-diff -ur -N xpdf-3.04.orig/xpdf/Page.cc xpdf-3.04/xpdf/Page.cc
---- xpdf-3.04.orig/xpdf/Page.cc	2014-05-28 20:50:50.000000000 +0200
-+++ xpdf-3.04/xpdf/Page.cc	2014-05-30 19:57:46.000000000 +0200
-@@ -468,9 +468,9 @@
-   delete links;
- }
- 
--#ifndef PDF_PARSER_ONLY
- void Page::getDefaultCTM(double *ctm, double hDPI, double vDPI,
- 			 int rotate, GBool useMediaBox, GBool upsideDown) {
-+#ifndef PDF_PARSER_ONLY
-   GfxState *state;
-   int i;
- 
-@@ -487,5 +487,5 @@
-     ctm[i] = state->getCTM()[i];
-   }
-   delete state;
--}
- #endif
-+}

Deleted: branches/stable/source/src/libs/xpdf/TLpatches/patch-20-skip-reading-config-file
===================================================================
--- branches/stable/source/src/libs/xpdf/TLpatches/patch-20-skip-reading-config-file	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/TLpatches/patch-20-skip-reading-config-file	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,60 +0,0 @@
-	Patches for pdfTeX / luaTeX / XeTeX
-
-	Declare GlobalParams constructor with a default config file argument
-	and skip reading a config file.
-
-	from:
-		Han The Thanh <thanh at pdftex.org>
-		Peter Breitenlohner <tex-live at tug.org>
-
-diff -ur -N xpdf-3.04.orig/xpdf/GlobalParams.cc xpdf-3.04/xpdf/GlobalParams.cc
---- xpdf-3.04.orig/xpdf/GlobalParams.cc	2014-05-28 20:50:50.000000000 +0200
-+++ xpdf-3.04/xpdf/GlobalParams.cc	2014-05-30 19:29:23.000000000 +0200
-@@ -5,6 +5,9 @@
- // Copyright 2001-2003 Glyph & Cog, LLC
- //
- //========================================================================
-+//  Modified for TeX Live by Peter Breitenlohner <tex-live at tug.org>
-+//  See top-level ChangeLog for a list of all modifications
-+//========================================================================
- 
- #include <aconf.h>
- 
-@@ -812,6 +815,7 @@
-   f = NULL;
-   fileName = NULL;
-   if (cfgFileName && cfgFileName[0]) {
-+#ifndef PDF_PARSER_ONLY
-     fileName = new GString(cfgFileName);
-     if (!(f = fopen(fileName->getCString(), "r"))) {
-       delete fileName;
-@@ -844,6 +848,7 @@
-     parseFile(fileName, f);
-     delete fileName;
-     fclose(f);
-+#endif /* !PDF_PARSER_ONLY */
-   }
- }
- 
-diff -ur -N xpdf-3.04.orig/xpdf/GlobalParams.h xpdf-3.04/xpdf/GlobalParams.h
---- xpdf-3.04.orig/xpdf/GlobalParams.h	2014-05-28 20:50:50.000000000 +0200
-+++ xpdf-3.04/xpdf/GlobalParams.h	2014-05-30 19:29:23.000000000 +0200
-@@ -5,6 +5,9 @@
- // Copyright 2001-2003 Glyph & Cog, LLC
- //
- //========================================================================
-+//  Modified for TeX Live by Peter Breitenlohner <tex-live at tug.org>
-+//  See top-level ChangeLog for a list of all modifications
-+//========================================================================
- 
- #ifndef GLOBALPARAMS_H
- #define GLOBALPARAMS_H
-@@ -173,7 +176,7 @@
- 
-   // Initialize the global parameters by attempting to read a config
-   // file.
--  GlobalParams(const char *cfgFileName);
-+  GlobalParams(const char *cfgFileName = NULL);
- 
-   ~GlobalParams();
- 

Deleted: branches/stable/source/src/libs/xpdf/TLpatches/patch-22-exclude-openTempFile
===================================================================
--- branches/stable/source/src/libs/xpdf/TLpatches/patch-22-exclude-openTempFile	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/TLpatches/patch-22-exclude-openTempFile	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,34 +0,0 @@
-	Patches for pdfTeX / luaTeX / XeTeX
-
-	from:
-		Han The Thanh <thanh at pdftex.org>
-
-diff -ur -N xpdf-3.04.orig/goo/gfile.cc xpdf-3.04/goo/gfile.cc
---- xpdf-3.04.orig/goo/gfile.cc	2014-05-28 20:50:50.000000000 +0200
-+++ xpdf-3.04/goo/gfile.cc	2014-05-30 19:42:41.000000000 +0200
-@@ -7,6 +7,9 @@
- // Copyright 1996-2003 Glyph & Cog, LLC
- //
- //========================================================================
-+//  Modified for TeX Live by Peter Breitenlohner <tex-live at tug.org>
-+//  See top-level ChangeLog for a list of all modifications
-+//========================================================================
- 
- #include <aconf.h>
- 
-@@ -441,6 +444,7 @@
- #endif
- }
- 
-+#ifndef PDF_PARSER_ONLY
- GBool openTempFile(GString **name, FILE **f,
- 		   const char *mode, const char *ext) {
- #if defined(_WIN32)
-@@ -551,6 +555,7 @@
-   return gTrue;
- #endif
- }
-+#endif
- 
- GBool createDir(char *path, int mode) {
- #ifdef _WIN32

Deleted: branches/stable/source/src/libs/xpdf/TLpatches/patch-30-include-strings_h
===================================================================
--- branches/stable/source/src/libs/xpdf/TLpatches/patch-30-include-strings_h	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/TLpatches/patch-30-include-strings_h	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,15 +0,0 @@
-	The Posix manpage says strcasecmp() is declared in <strings.h>
-	and this indeed required for AIX 4.3 and xlc.
-
-diff -ur -N xpdf-3.04.orig/xpdf/GlobalParams.cc xpdf-3.04/xpdf/GlobalParams.cc
---- xpdf-3.04.orig/xpdf/GlobalParams.cc	2014-05-30 19:29:23.000000000 +0200
-+++ xpdf-3.04/xpdf/GlobalParams.cc	2014-05-30 19:47:44.000000000 +0200
-@@ -54,6 +54,8 @@
- #ifdef _WIN32
- #  define strcasecmp stricmp
- #  define strncasecmp strnicmp
-+#else
-+#  include <strings.h>
- #endif
- 
- #if MULTITHREADED

Deleted: branches/stable/source/src/libs/xpdf/TLpatches/patch-40-W32TeX
===================================================================
--- branches/stable/source/src/libs/xpdf/TLpatches/patch-40-W32TeX	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/TLpatches/patch-40-W32TeX	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,29 +0,0 @@
-	WIN32TeX uses MSVC 5.0 with the kpathsea headers and library.
-
-diff -ur -N xpdf-3.04.orig/xpdf/GlobalParams.cc xpdf-3.04/xpdf/GlobalParams.cc
---- xpdf-3.04.orig/xpdf/GlobalParams.cc	2014-05-30 19:47:44.000000000 +0200
-+++ xpdf-3.04/xpdf/GlobalParams.cc	2014-05-30 19:52:04.000000000 +0200
-@@ -52,6 +52,8 @@
- #include "GlobalParams.h"
- 
- #ifdef _WIN32
-+#  undef strcasecmp
-+#  undef strncasecmp
- #  define strcasecmp stricmp
- #  define strncasecmp strnicmp
- #else
-diff -ur -N xpdf-3.04.orig/xpdf/config.h xpdf-3.04/xpdf/config.h
---- xpdf-3.04.orig/xpdf/config.h	2014-05-28 20:50:50.000000000 +0200
-+++ xpdf-3.04/xpdf/config.h	2014-05-30 19:52:04.000000000 +0200
-@@ -78,11 +78,6 @@
- // popen
- //------------------------------------------------------------------------
- 
--#if defined(_MSC_VER) || defined(__BORLANDC__)
--#define popen _popen
--#define pclose _pclose
--#endif
--
- #if defined(VMS) || defined(VMCMS) || defined(DOS) || defined(OS2) || defined(__EMX__) || defined(_WIN32) || defined(__DJGPP__) || defined(MACOS)
- #define POPEN_READ_MODE "rb"
- #else

Deleted: branches/stable/source/src/libs/xpdf/TLpatches/patch-41-W32TeX
===================================================================
--- branches/stable/source/src/libs/xpdf/TLpatches/patch-41-W32TeX	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/TLpatches/patch-41-W32TeX	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,177 +0,0 @@
-diff -ur -N xpdf-3.04.orig/goo/gfile.cc xpdf-3.04/goo/gfile.cc
---- xpdf-3.04.orig/goo/gfile.cc	2014-05-30 19:42:41.000000000 +0200
-+++ xpdf-3.04/goo/gfile.cc	2015-05-09 15:49:36.000000000 +0200
-@@ -55,7 +55,11 @@
-   char *s;
-   GString *ret;
- 
-+#ifdef _WIN32
-+  if ((s = getenv("USERPROFILE")))
-+#else
-   if ((s = getenv("HOME")))
-+#endif
-     ret = new GString(s);
-   else
-     ret = new GString(".");
-@@ -559,7 +563,7 @@
- 
- GBool createDir(char *path, int mode) {
- #ifdef _WIN32
--  return !mkdir(path);
-+  return !_mkdir(path);
- #else
-   return !mkdir(path, mode);
- #endif
-diff -ur -N xpdf-3.04.orig/xpdf/GlobalParams.cc xpdf-3.04/xpdf/GlobalParams.cc
---- xpdf-3.04.orig/xpdf/GlobalParams.cc	2014-05-30 19:52:04.000000000 +0200
-+++ xpdf-3.04/xpdf/GlobalParams.cc	2015-05-07 08:43:30.000000000 +0200
-@@ -16,7 +16,9 @@
- #endif
- 
- #ifdef _WIN32
-+#  ifndef _WIN32_WINNT
- #  define _WIN32_WINNT 0x0500 // for GetSystemWindowsDirectory
-+#  endif
- #  include <windows.h>
- #endif
- #include <string.h>
-@@ -54,8 +56,8 @@
- #ifdef _WIN32
- #  undef strcasecmp
- #  undef strncasecmp
--#  define strcasecmp stricmp
--#  define strncasecmp strnicmp
-+#  define strcasecmp _stricmp
-+#  define strncasecmp _strnicmp
- #else
- #  include <strings.h>
- #endif
-@@ -2138,8 +2140,11 @@
- 				   base14->fontNum,
- 				   displayFontTab[i].obliqueFactor));
-       } else {
-+// Do not display unnecessary looking message on W32
-+#ifndef _WIN32
- 	error(errConfig, -1, "No display font for '{0:s}'",
- 	      displayFontTab[i].name);
-+#endif
-       }
-     }
-   }
-diff -ur -N xpdf-3.04.orig/xpdf/pdfdetach.cc xpdf-3.04/xpdf/pdfdetach.cc
---- xpdf-3.04.orig/xpdf/pdfdetach.cc	2014-05-28 20:50:50.000000000 +0200
-+++ xpdf-3.04/xpdf/pdfdetach.cc	2015-05-07 08:43:30.000000000 +0200
-@@ -74,6 +74,9 @@
- 
-   exitCode = 99;
- 
-+#ifdef _MSC_VER
-+  (void)kpse_set_program_name(argv[0], NULL);
-+#endif
-   // parse args
-   ok = parseArgs(argDesc, &argc, argv);
-   if ((doList ? 1 : 0) +
-diff -ur -N xpdf-3.04.orig/xpdf/pdffonts.cc xpdf-3.04/xpdf/pdffonts.cc
---- xpdf-3.04.orig/xpdf/pdffonts.cc	2014-05-28 20:50:50.000000000 +0200
-+++ xpdf-3.04/xpdf/pdffonts.cc	2015-05-07 08:43:30.000000000 +0200
-@@ -107,6 +107,9 @@
- 
-   exitCode = 99;
- 
-+#ifdef _MSC_VER
-+  (void)kpse_set_program_name(argv[0], NULL);
-+#endif
-   // parse args
-   ok = parseArgs(argDesc, &argc, argv);
-   if (!ok || argc != 2 || printVersion || printHelp) {
-diff -ur -N xpdf-3.04.orig/xpdf/pdfimages.cc xpdf-3.04/xpdf/pdfimages.cc
---- xpdf-3.04.orig/xpdf/pdfimages.cc	2014-05-28 20:50:50.000000000 +0200
-+++ xpdf-3.04/xpdf/pdfimages.cc	2015-05-07 08:43:30.000000000 +0200
-@@ -76,6 +76,9 @@
- 
-   exitCode = 99;
- 
-+#ifdef _MSC_VER
-+  (void)kpse_set_program_name(argv[0], NULL);
-+#endif
-   // parse args
-   ok = parseArgs(argDesc, &argc, argv);
-   if (!ok || argc != 3 || printVersion || printHelp) {
-diff -ur -N xpdf-3.04.orig/xpdf/pdfinfo.cc xpdf-3.04/xpdf/pdfinfo.cc
---- xpdf-3.04.orig/xpdf/pdfinfo.cc	2014-05-28 20:50:50.000000000 +0200
-+++ xpdf-3.04/xpdf/pdfinfo.cc	2015-05-07 08:43:30.000000000 +0200
-@@ -100,6 +100,9 @@
- 
-   exitCode = 99;
- 
-+#ifdef _MSC_VER
-+  (void)kpse_set_program_name(argv[0], NULL);
-+#endif
-   // parse args
-   ok = parseArgs(argDesc, &argc, argv);
-   if (!ok || argc != 2 || printVersion || printHelp) {
-diff -ur -N xpdf-3.04.orig/xpdf/pdftohtml.cc xpdf-3.04/xpdf/pdftohtml.cc
---- xpdf-3.04.orig/xpdf/pdftohtml.cc	2014-05-28 20:50:50.000000000 +0200
-+++ xpdf-3.04/xpdf/pdftohtml.cc	2015-05-07 08:43:30.000000000 +0200
-@@ -86,6 +86,9 @@
- 
-   exitCode = 99;
- 
-+#ifdef _MSC_VER
-+  (void)kpse_set_program_name(argv[0], NULL);
-+#endif
-   // parse args
-   ok = parseArgs(argDesc, &argc, argv);
-   if (!ok || argc != 3 || printVersion || printHelp) {
-diff -ur -N xpdf-3.04.orig/xpdf/pdftopng.cc xpdf-3.04/xpdf/pdftopng.cc
---- xpdf-3.04.orig/xpdf/pdftopng.cc	2014-05-28 20:50:50.000000000 +0200
-+++ xpdf-3.04/xpdf/pdftopng.cc	2015-05-07 08:43:30.000000000 +0200
-@@ -99,6 +99,9 @@
- 
-   exitCode = 99;
- 
-+#ifdef _MSC_VER
-+  (void)kpse_set_program_name(argv[0], NULL);
-+#endif
-   // parse args
-   ok = parseArgs(argDesc, &argc, argv);
-   if (mono && gray) {
-diff -ur -N xpdf-3.04.orig/xpdf/pdftoppm.cc xpdf-3.04/xpdf/pdftoppm.cc
---- xpdf-3.04.orig/xpdf/pdftoppm.cc	2014-05-28 20:50:50.000000000 +0200
-+++ xpdf-3.04/xpdf/pdftoppm.cc	2015-05-07 08:43:30.000000000 +0200
-@@ -111,6 +111,9 @@
- 
-   exitCode = 99;
- 
-+#ifdef _MSC_VER
-+  (void)kpse_set_program_name(argv[0], NULL);
-+#endif
-   // parse args
-   ok = parseArgs(argDesc, &argc, argv);
-   if (mono && gray) {
-diff -ur -N xpdf-3.04.orig/xpdf/pdftops.cc xpdf-3.04/xpdf/pdftops.cc
---- xpdf-3.04.orig/xpdf/pdftops.cc	2014-05-28 20:50:50.000000000 +0200
-+++ xpdf-3.04/xpdf/pdftops.cc	2015-05-07 08:43:30.000000000 +0200
-@@ -168,6 +168,9 @@
- 
-   exitCode = 99;
- 
-+#ifdef _MSC_VER
-+  (void)kpse_set_program_name(argv[0], NULL);
-+#endif
-   // parse args
-   ok = parseArgs(argDesc, &argc, argv);
-   if (!ok || argc < 2 || argc > 3 || printVersion || printHelp) {
-diff -ur -N xpdf-3.04.orig/xpdf/pdftotext.cc xpdf-3.04/xpdf/pdftotext.cc
---- xpdf-3.04.orig/xpdf/pdftotext.cc	2014-05-28 20:50:50.000000000 +0200
-+++ xpdf-3.04/xpdf/pdftotext.cc	2015-05-07 08:43:30.000000000 +0200
-@@ -129,6 +129,9 @@
- 
-   exitCode = 99;
- 
-+#ifdef _MSC_VER
-+  (void)kpse_set_program_name(argv[0], NULL);
-+#endif
-   // parse args
-   ok = parseArgs(argDesc, &argc, argv);
-   if (!ok || argc < 2 || argc > 3 || printVersion || printHelp) {

Added: branches/stable/source/src/libs/xpdf/TLpatches/patch-bunched
===================================================================
--- branches/stable/source/src/libs/xpdf/TLpatches/patch-bunched	                        (rev 0)
+++ branches/stable/source/src/libs/xpdf/TLpatches/patch-bunched	2017-11-01 18:15:56 UTC (rev 780)
@@ -0,0 +1,176 @@
+diff -ur xpdf-4.00.orig/goo/gfile.cc xpdf-4.00/goo/gfile.cc
+--- xpdf-4.00.orig/goo/gfile.cc	Wed Aug 09 08:22:50 2017
++++ xpdf-4.00/goo/gfile.cc	Sun Aug 13 13:46:03 2017
+@@ -7,6 +7,9 @@
+ // Copyright 1996-2003 Glyph & Cog, LLC
+ //
+ //========================================================================
++//  Modified for TeX Live by Peter Breitenlohner <tex-live at tug.org>
++//  See top-level ChangeLog for a list of all modifications
++//========================================================================
+ 
+ #include <aconf.h>
+ 
+@@ -51,7 +54,11 @@
+   char *s;
+   GString *ret;
+ 
++#ifdef _WIN32
++  if ((s = getenv("USERPROFILE")))
++#else
+   if ((s = getenv("HOME")))
++#endif
+     ret = new GString(s);
+   else
+     ret = new GString(".");
+@@ -400,6 +407,7 @@
+ #endif
+ }
+ 
++#ifndef PDF_PARSER_ONLY
+ GBool openTempFile(GString **name, FILE **f,
+ 		   const char *mode, const char *ext) {
+ #if defined(_WIN32)
+@@ -514,10 +522,11 @@
+   return gTrue;
+ #endif
+ }
++#endif
+ 
+ GBool createDir(char *path, int mode) {
+ #ifdef _WIN32
+-  return !mkdir(path);
++  return !_mkdir(path);
+ #else
+   return !mkdir(path, mode);
+ #endif
+diff -ur xpdf-4.00.orig/xpdf/GlobalParams.cc xpdf-4.00/xpdf/GlobalParams.cc
+--- xpdf-4.00.orig/xpdf/GlobalParams.cc	Wed Aug 09 08:22:50 2017
++++ xpdf-4.00/xpdf/GlobalParams.cc	Sun Aug 13 13:51:37 2017
+@@ -5,6 +5,9 @@
+ // Copyright 2001-2003 Glyph & Cog, LLC
+ //
+ //========================================================================
++//  Modified for TeX Live by Peter Breitenlohner <tex-live at tug.org>
++//  See top-level ChangeLog for a list of all modifications
++//========================================================================
+ 
+ #include <aconf.h>
+ 
+@@ -38,8 +41,12 @@
+ #include "GlobalParams.h"
+ 
+ #ifdef _WIN32
+-#  define strcasecmp stricmp
+-#  define strncasecmp strnicmp
++#  undef strcasecmp
++#  undef strncasecmp
++#  define strcasecmp _stricmp
++#  define strncasecmp _strnicmp
++#else
++#  include <strings.h>
+ #endif
+ 
+ #if MULTITHREADED
+@@ -677,6 +684,7 @@
+   f = NULL;
+   fileName = NULL;
+   if (cfgFileName && cfgFileName[0]) {
++#ifndef PDF_PARSER_ONLY
+     fileName = new GString(cfgFileName);
+     if (!(f = fopen(fileName->getCString(), "r"))) {
+       delete fileName;
+@@ -709,6 +717,7 @@
+     parseFile(fileName, f);
+     delete fileName;
+     fclose(f);
++#endif /* !PDF_PARSER_ONLY */
+   }
+ }
+ 
+@@ -2105,8 +2114,11 @@
+ 				   base14->fontNum,
+ 				   displayFontTab[i].obliqueFactor));
+       } else {
++// Do not display unnecessary looking message on W32
++#ifndef _WIN32
+ 	error(errConfig, -1, "No display font for '{0:s}'",
+ 	      displayFontTab[i].name);
++#endif
+       }
+     }
+   }
+diff -ur xpdf-4.00.orig/xpdf/GlobalParams.h xpdf-4.00/xpdf/GlobalParams.h
+--- xpdf-4.00.orig/xpdf/GlobalParams.h	Wed Aug 09 08:22:50 2017
++++ xpdf-4.00/xpdf/GlobalParams.h	Sun Aug 13 13:32:19 2017
+@@ -5,6 +5,9 @@
+ // Copyright 2001-2003 Glyph & Cog, LLC
+ //
+ //========================================================================
++//  Modified for TeX Live by Peter Breitenlohner <tex-live at tug.org>
++//  See top-level ChangeLog for a list of all modifications
++//========================================================================
+ 
+ #ifndef GLOBALPARAMS_H
+ #define GLOBALPARAMS_H
+@@ -217,7 +220,7 @@
+ 
+   // Initialize the global parameters by attempting to read a config
+   // file.
+-  GlobalParams(const char *cfgFileName);
++  GlobalParams(const char *cfgFileName = NULL);
+ 
+   ~GlobalParams();
+ 
+diff -ur xpdf-4.00.orig/xpdf/Page.cc xpdf-4.00/xpdf/Page.cc
+--- xpdf-4.00.orig/xpdf/Page.cc	Wed Aug 09 08:22:50 2017
++++ xpdf-4.00/xpdf/Page.cc	Sun Aug 13 13:24:07 2017
+@@ -480,9 +480,9 @@
+   delete links;
+ }
+ 
+-#ifndef PDF_PARSER_ONLY
+ void Page::getDefaultCTM(double *ctm, double hDPI, double vDPI,
+ 			 int rotate, GBool useMediaBox, GBool upsideDown) {
++#ifndef PDF_PARSER_ONLY
+   GfxState *state;
+   int i;
+ 
+@@ -499,5 +499,5 @@
+     ctm[i] = state->getCTM()[i];
+   }
+   delete state;
+-}
+ #endif
++}
+diff -ur xpdf-4.00.orig/xpdf/XFAForm.cc xpdf-4.00/xpdf/XFAForm.cc
+--- xpdf-4.00.orig/xpdf/XFAForm.cc	Wed Aug 09 08:22:50 2017
++++ xpdf-4.00/xpdf/XFAForm.cc	Sun Aug 13 14:28:34 2017
+@@ -27,8 +27,10 @@
+ #include "XFAForm.h"
+ 
+ #ifdef _WIN32
+-#  define strcasecmp stricmp
+-#  define strncasecmp strnicmp
++#  undef strcasecmp
++#  undef strncasecmp
++#  define strcasecmp _stricmp
++#  define strncasecmp _strnicmp
+ #endif
+ 
+ //------------------------------------------------------------------------
+diff -ur xpdf-4.00.orig/xpdf/config.h xpdf-4.00/xpdf/config.h
+--- xpdf-4.00.orig/xpdf/config.h	Wed Aug 09 08:22:50 2017
++++ xpdf-4.00/xpdf/config.h	Sun Aug 13 13:42:04 2017
+@@ -78,11 +78,6 @@
+ // popen
+ //------------------------------------------------------------------------
+ 
+-#if defined(_MSC_VER) || defined(__BORLANDC__)
+-#define popen _popen
+-#define pclose _pclose
+-#endif
+-
+ #if defined(VMS) || defined(VMCMS) || defined(DOS) || defined(OS2) || defined(__EMX__) || defined(_WIN32) || defined(__DJGPP__)
+ #define POPEN_READ_MODE "rb"
+ #else

Modified: branches/stable/source/src/libs/xpdf/aclocal.m4
===================================================================
--- branches/stable/source/src/libs/xpdf/aclocal.m4	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/aclocal.m4	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,6 +1,6 @@
-# generated automatically by aclocal 1.15 -*- Autoconf -*-
+# generated automatically by aclocal 1.15.1 -*- Autoconf -*-
 
-# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+# Copyright (C) 1996-2017 Free Software Foundation, Inc.
 
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -20,7 +20,7 @@
 If you have problems, you may need to regenerate the build system entirely.
 To do so, use the procedure documented by the package, typically 'autoreconf'.])])
 
-# Copyright (C) 2002-2014 Free Software Foundation, Inc.
+# Copyright (C) 2002-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -35,7 +35,7 @@
 [am__api_version='1.15'
 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
 dnl require some minimum version.  Point them to the right macro.
-m4_if([$1], [1.15], [],
+m4_if([$1], [1.15.1], [],
       [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
 ])
 
@@ -51,7 +51,7 @@
 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.15])dnl
+[AM_AUTOMAKE_VERSION([1.15.1])dnl
 m4_ifndef([AC_AUTOCONF_VERSION],
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
@@ -58,7 +58,7 @@
 
 # AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
 
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -110,7 +110,7 @@
 
 # AM_CONDITIONAL                                            -*- Autoconf -*-
 
-# Copyright (C) 1997-2014 Free Software Foundation, Inc.
+# Copyright (C) 1997-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -141,7 +141,7 @@
 Usually this means the macro was only invoked conditionally.]])
 fi])])
 
-# Copyright (C) 1999-2014 Free Software Foundation, Inc.
+# Copyright (C) 1999-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -332,7 +332,7 @@
 
 # Generate code to set up dependency tracking.              -*- Autoconf -*-
 
-# Copyright (C) 1999-2014 Free Software Foundation, Inc.
+# Copyright (C) 1999-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -408,7 +408,7 @@
 
 # Do all the work for Automake.                             -*- Autoconf -*-
 
-# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+# Copyright (C) 1996-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -605,7 +605,7 @@
 done
 echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
 
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -626,7 +626,7 @@
 fi
 AC_SUBST([install_sh])])
 
-# Copyright (C) 2003-2014 Free Software Foundation, Inc.
+# Copyright (C) 2003-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -648,7 +648,7 @@
 # Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
 # From Jim Meyering
 
-# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+# Copyright (C) 1996-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -683,7 +683,7 @@
 
 # Check to see how 'make' treats includes.	            -*- Autoconf -*-
 
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -733,7 +733,7 @@
 
 # Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
 
-# Copyright (C) 1997-2014 Free Software Foundation, Inc.
+# Copyright (C) 1997-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -772,7 +772,7 @@
 
 # Helper functions for option handling.                     -*- Autoconf -*-
 
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -801,7 +801,7 @@
 AC_DEFUN([_AM_IF_OPTION],
 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
 
-# Copyright (C) 1999-2014 Free Software Foundation, Inc.
+# Copyright (C) 1999-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -848,7 +848,7 @@
 # For backward compatibility.
 AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
 
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -867,7 +867,7 @@
 
 # Check to make sure that the build environment is sane.    -*- Autoconf -*-
 
-# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+# Copyright (C) 1996-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -948,7 +948,7 @@
 rm -f conftest.file
 ])
 
-# Copyright (C) 2009-2014 Free Software Foundation, Inc.
+# Copyright (C) 2009-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1008,7 +1008,7 @@
 _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
 ])
 
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1036,7 +1036,7 @@
 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
 AC_SUBST([INSTALL_STRIP_PROGRAM])])
 
-# Copyright (C) 2006-2014 Free Software Foundation, Inc.
+# Copyright (C) 2006-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1055,7 +1055,7 @@
 
 # Check how to create a tarball.                            -*- Autoconf -*-
 
-# Copyright (C) 2004-2014 Free Software Foundation, Inc.
+# Copyright (C) 2004-2017 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,

Modified: branches/stable/source/src/libs/xpdf/configure
===================================================================
--- branches/stable/source/src/libs/xpdf/configure	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/configure	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for xpdf (TeX Live) 3.04.
+# Generated by GNU Autoconf 2.69 for xpdf (TeX Live) 4.00.
 #
 # Report bugs to <tex-k at tug.org>.
 #
@@ -580,8 +580,8 @@
 # Identity of this package.
 PACKAGE_NAME='xpdf (TeX Live)'
 PACKAGE_TARNAME='xpdf--tex-live-'
-PACKAGE_VERSION='3.04'
-PACKAGE_STRING='xpdf (TeX Live) 3.04'
+PACKAGE_VERSION='4.00'
+PACKAGE_STRING='xpdf (TeX Live) 4.00'
 PACKAGE_BUGREPORT='tex-k at tug.org'
 PACKAGE_URL=''
 
@@ -1290,7 +1290,7 @@
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures xpdf (TeX Live) 3.04 to adapt to many kinds of systems.
+\`configure' configures xpdf (TeX Live) 4.00 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1356,7 +1356,7 @@
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of xpdf (TeX Live) 3.04:";;
+     short | recursive ) echo "Configuration of xpdf (TeX Live) 4.00:";;
    esac
   cat <<\_ACEOF
 
@@ -1460,7 +1460,7 @@
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-xpdf (TeX Live) configure 3.04
+xpdf (TeX Live) configure 4.00
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1867,7 +1867,7 @@
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by xpdf (TeX Live) $as_me 3.04, which was
+It was created by xpdf (TeX Live) $as_me 4.00, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -3790,7 +3790,7 @@
 
 # Define the identity of the package.
  PACKAGE='xpdf--tex-live-'
- VERSION='3.04'
+ VERSION='4.00'
 
 
 # Some tools Automake needs.
@@ -6703,7 +6703,7 @@
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by xpdf (TeX Live) $as_me 3.04, which was
+This file was extended by xpdf (TeX Live) $as_me 4.00, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -6773,7 +6773,7 @@
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-xpdf (TeX Live) config.status 3.04
+xpdf (TeX Live) config.status 4.00
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 

Modified: branches/stable/source/src/libs/xpdf/fofi/Makefile.in
===================================================================
--- branches/stable/source/src/libs/xpdf/fofi/Makefile.in	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/fofi/Makefile.in	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.15.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2017 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,

Modified: branches/stable/source/src/libs/xpdf/goo/Makefile.in
===================================================================
--- branches/stable/source/src/libs/xpdf/goo/Makefile.in	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/goo/Makefile.in	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.15.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2017 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,

Modified: branches/stable/source/src/libs/xpdf/splash/Makefile.in
===================================================================
--- branches/stable/source/src/libs/xpdf/splash/Makefile.in	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/splash/Makefile.in	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.15.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2017 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,

Modified: branches/stable/source/src/libs/xpdf/version.ac
===================================================================
--- branches/stable/source/src/libs/xpdf/version.ac	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/version.ac	2017-11-01 18:15:56 UTC (rev 780)
@@ -8,4 +8,4 @@
 dnl --------------------------------------------------------
 dnl
 dnl  m4-include this file to define the current xpdf version
-m4_define([xpdf_version], [3.04])
+m4_define([xpdf_version], [4.00])

Modified: branches/stable/source/src/libs/xpdf/xpdf/Makefile.in
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf/Makefile.in	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/xpdf/Makefile.in	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.15.1 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2017 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/ANNOUNCE
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/ANNOUNCE	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/ANNOUNCE	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,31 +1,33 @@
-Subject: ANNOUNCE: Xpdf 3.04 - a PDF viewer for X
+Subject: ANNOUNCE: Xpdf 4.00 - a PDF viewer and related tools
 
-
 Glyph & Cog, LLC is pleased to announce a new version of Xpdf, the
-open source Portable Document Format (PDF) viewer for X.  The Xpdf
-project also includes a PDF text extractor, PDF-to-PostScript
-converter, and various other utilities.
+open source Portable Document Format (PDF) viewer.  The Xpdf project
+also includes a PDF text extractor, PDF-to-PostScript converter, and
+various other utilities.
 
-Xpdf runs under the X Window System on Unix, and OS/2.  The non-X
-components (pdftops, pdftotext, etc.) also run on Win32 systems and
-should run on pretty much any system with a decent C++ compiler.
+*** The Xpdf web site has moved to www.xpdfreader.com ***
 
+Xpdf uses the Qt toolkit and runs on Linux and Windows.  The
+non-graphical components (pdftops, pdftotext, etc.) run on Linux,
+Unix, Windows, MacOSX, and pretty much any other system with a decent
+C++ compiler.
+
 Major changes:
-* New text extractor.
-* Added the pdftohtml tool.
-* Added the pdftopng tool.
-* New trapezoid-based rasterizer core (for performance).
+* Complete rewrite of the xpdf GUI, using Qt instead of Motif.
+* Multithreaded rasterization in the viewer - pages are now rasterized
+  in a separate thread so that scrolling and other UI activity is not
+  blocked.
+* Added a linear text selection mode.
 
 See the `CHANGES' file for a complete list of changes.
 
 Source (C++ and C) is available, and it should be fairly easy to
-compile for UNIX, OS/2, and Win32.
+compile for Linux and Windows.
 
 More information, source code, and precompiled binaries are on the
-xpdf web page and ftp site:
+xpdf web page:
 
-    http://www.foolabs.com/xpdf/
-    ftp://ftp.foolabs.com/pub/xpdf/
+    http://www.xpdfreader.com/
 
 For information on commercial licensing and consulting, please see the
 Glyph & Cog web site:

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/CHANGES
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/CHANGES	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/CHANGES	2017-11-01 18:15:56 UTC (rev 780)
@@ -2321,3 +2321,136 @@
   size, do it in stream mode instead of prescaling the whole image
   (to avoid running out of memory).
 Added infinite loop detection to pdffonts.
+
+4.00 (2017-aug-10)
+------------------
+Complete rewrite of the xpdf GUI, using Qt instead of Motif.
+Multithreaded rasterization in the viewer - pages are now rasterized
+  in a separate thread so that scrolling and other UI activity is not
+  blocked.
+Added a linear text selection mode.
+Limit transparency groups to the clip rectangle (performance
+  optimization).
+Optimized the SplashScreen code, used in 1-bit monochrome mode.
+Added setmode calls to pdftopng, when writing to stdout on Windows.
+  [Thanks to Robert Schroll.]
+Regenerate the appearance stream for an AcroForm field if there is
+  no appearance stream, even if NeedAppearances isn't set.
+When regenerating AcroForm field appearance streams, use a default
+  font (Helvetica) for fields that don't have a valid font.
+When the line width is increased by the minLineWidth setting, force
+  the line join mode to "bevel" to avoid "whiskers" at sharp corners.
+Change the pdftoppm/pdftopng resolution (-r) argument from an integer
+  to floating point.
+Use the FontDescriptor 'CapHeight' value in place of 'Ascent' if it's
+  available.
+OC (optional content) entries in image XObjects were being ignored.
+Added support for preblended soft-masked images.
+Added optional support for using libjpeg to decode DCT (JPEG)
+  streams.
+Transparency groups weren't being composited correctly in mono1 mode.
+Switched to a different IDCT transform in the DCT (JPEG) decoder, to
+  get better accuracy; the new transform is also a bit faster.
+Modified the polygon scan converter to avoid O(n^2) performance, which
+  can get really bad with paths that have extremely large numbers of
+  segments.
+Added the maxTileWidth, maxTileHeight, tileCacheSize, and
+  workerThreads xpdfrc settings.
+Modified PSOutputDev so it doesn't output resources (fonts, etc.) for
+  pages that are rasterized (because they use transparency).
+Added the -alpha flag to pdftopng.
+Handle TrueType fonts with out-of-bounds loca entries.
+Optimize consectutive "q" (gsave) operations in PostScript output.
+Various improvements to the XFA rendering code.
+Added the -nodiag flag to pdftotext.
+Switched to cmake instead of autoconf.
+Look for Widget-type annotations that aren't attached to the
+  AcroForm, and add them to the AcroForm.
+Added the "-z" option to pdftohtml.
+The JPEG 2000 decoder now treats invalid boxes after the image
+  codestream as non-fatal errors.
+Improved the handling of drop caps in pdftohtml.
+Added the "psNeverRasterize" setting.
+Pdftohtml now converts invisible PDF text to transparent HTML text.
+Check for zero-width/height bitmaps in the JBIG2 decoder -- these can
+  happen in corrupted JBIG2 streams.
+Pdfimages was inverting 1-bit monochrome images.
+Added CCITTFaxStream::getBlock() to speed up the CCITTFax decoder.
+Added resolution info to PNG files generated by pdftopng.
+The DCT decoder now ignores non-Adobe APP14 markers (rather than
+  generating an error).
+Regenerate appearance streams for FreeText annotations.
+The TextString class now handles UTF-16LE in addition to UTF-16BE.
+  (UTF-16LE isn't allowed by the PDF spec, but I've seen it used.)
+Added the simple one-column text extraction mode (pdftotext -simple).
+Added a -cmyk option to pdftoppm to write CMYK PAM files.
+Modified pdfinfo to output "static XFA" or "dynamic XFA", rather than
+  just "XFA".
+Added the "drawFormFields" xpdfrc command.
+Various performance optimizations in the rasterizer.
+Fixed the tiling pattern code to avoid stripes between pattern cells,
+  and to honor the TilingType flag.
+Always split axial shadings into 256 slices.
+Handle the case where an optional content block is left open at the
+  end of a page content stream.
+Accept code-to-CID-type CMaps as ToUnicode CMaps (to work around buggy
+  PDF generators).
+Unicode-to-unicode maps weren't working correctly with fonts that have
+  an "Identity" encoding.
+Modify the lexer to interpret "--123.4" as -123.4, "--123" as 0, and
+  "123-45" as "123" to match Adobe's behavior.
+The text extractor now reverses the order of side-by-side columns for
+  right-to-left scripts.
+Worked on right-to-left script support in pdftohtml (still not
+  complete).
+Switched the default display mode to continuous (from single page).
+Added the "-bom" switch to pdftotext.
+Share font objects when multiple font tags point to the same object.
+The transfer function goes before alpha blending in the rasterizer
+  pipeline.
+Added the "-allinvisible" switch to pdftohtml.
+Added overprint mode (OPM) support in Level 3 PostScript output.
+Added support for DeviceN color spaces in Level 3 PostScript output.
+Added the "-userunit" option to pdftops.
+Added the "-raw" and "-list" options to pdfimages.
+Pdfimages now writes PGM files (instead of PPM files) for DeviceGray
+  and CalGray images.
+Added grayscale PostScript output -- added the '-level2gray' and
+  '-level3gray' switches to pdftops.
+Fix up Type 1 fonts when embedding in PostScript.
+Added the "problematic" column to pdffonts output.
+Generate an appearance stream for signature fields in AcroForms.
+Correctly handle line dash patterns with zero-length segments when the
+  line cap is butt or project.
+Added the "strokeAdjust cad" xpdfrc option; fixed some issues with
+  stroke adjustment and projecting line caps.
+Added support for Code128B bar codes in XFA forms.
+Look at both the ON and OFF arrays in the default OCCD (optional
+  content config dict), to work around certain broken PDF files.
+Added support for XFA 'numericEdit' fields.
+Added support for 'picture' formatting in XFA forms.
+Added mouseClickN events (in addition to mousePressN and
+  mouseReleaseN).
+External CID OpenType CFF fonts should map through Unicode (similarly
+  to external CID TrueType fonts).
+Handle axial and radial shadings in SplashOutputDev, in device space.
+Use the PDF 2.0 inline image length field.
+Handle duplicate embedded Type 1 font names in PostScript output.
+Handle the case of a stroked closed path with a dash pattern -- if the
+  dash pattern is "on" at both the start and end of a subpath, it
+  should be joined.
+If the line dash phase is negative, add a multiple of 2x the total
+  dash length.
+Indexed color space indexes should be clipped to [0,hival].
+Fix the handling of the text render mode with Type 3 fonts, in the
+  rasterizer and in PostScript output.
+CID font metrics shouldn't be sorted - the PDF 2.0 spec says that, in
+  the case of duplicate entries, the first entry should be used.
+PSOutputDev now converts tiling patterns to PostScript tiling patterns
+  (in Level 2/3).
+Fixed a security hole in SecurityHandler.cc (uninitialized variables).
+  This vulnerability was discovered by Kushal Shah of Fortinet's
+  FortiGuard Labs.
+Fixed a security hole in Function.cc (write past end of array).
+Fixed a security hole with the use of d0/d1 operators outside of a
+  Type3 CharProc [CVE-2016-9027].

Added: branches/stable/source/src/libs/xpdf/xpdf-src/CMakeLists.txt
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/CMakeLists.txt	                        (rev 0)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/CMakeLists.txt	2017-11-01 18:15:56 UTC (rev 780)
@@ -0,0 +1,41 @@
+#========================================================================
+#
+# cmake-xpdf.txt
+#
+# CMake script for the Xpdf package.
+#
+# Copyright 2015 Glyph & Cog, LLC
+#
+#========================================================================
+
+cmake_minimum_required(VERSION 2.8.8)
+
+project(xpdf)
+
+include(cmake-config.txt)
+
+add_subdirectory(goo)
+add_subdirectory(fofi)
+add_subdirectory(splash)
+add_subdirectory(xpdf)
+add_subdirectory(xpdf-qt)
+
+if (NOT HAVE_FREETYPE_H)
+  message(WARNING "Couldn't find FreeType -- will not build pdftoppm, pdftopng, pdftohtml, or xpdf.")
+endif ()
+
+if (NOT PNG_FOUND)
+  message(WARNING "Couldn't find libpng -- will not build pdftopng or pdftohtml.")
+endif ()
+
+if (NOT QT4_FOUND AND NOT Qt5Widgets_FOUND)
+  message(WARNING "Couldn't find Qt4 or Qt5 -- will not build xpdf.")
+endif ()
+
+if (NOT MULTITHREADED)
+  message(WARNING "Multithreading is disabled -- will not build xpdf.")
+endif ()
+
+if (NOT USE_EXCEPTIONS)
+  message(WARNING "C++ exceptions are disabled -- will not build xpdf.")
+endif ()


Property changes on: branches/stable/source/src/libs/xpdf/xpdf-src/CMakeLists.txt
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: branches/stable/source/src/libs/xpdf/xpdf-src/INSTALL
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/INSTALL	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/INSTALL	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,14 +1,14 @@
 Xpdf
 ====
 
-version 3.04
-2014-may-28
+version 4.00
+2017-aug-10
 
 The Xpdf software and documentation are
-copyright 1996-2014 Glyph & Cog, LLC.
+copyright 1996-2017 Glyph & Cog, LLC.
 
-Email: derekn at foolabs.com
-WWW: http://www.foolabs.com/xpdf/
+Email: xpdf at xpdfreader.com
+WWW: http://www.xpdfreader.com/
 
 
 Compiling xpdf
@@ -18,179 +18,157 @@
 any ANSI-compliant C++ and C compilers.  The systems and compilers
 it's been tested with are listed on the xpdf web page.
 
-Xpdf requires the Motif (or Lesstif) toolkit.
+Xpdf requires the Qt toolkit.  The non-GUI command line tools do not
+use Qt.
 
 The following notes give specific instructions for compiling on
 different systems.
 
 
-**************
-***  UNIX  ***
-**************
+*********************
+***  Linux, OS X  ***
+*********************
 
-* Install FreeType 2 (this is required).  WARNING: You must have
-  version 2.0.5 or newer.  Some older versions of XFree86 ship with an
-  older version of FreeType, which means you'll need to explicitly set
-  include and library paths to get the correct version:
+* Make sure you have the following installed:
 
-    --with-freetype2-library=PATH
-    --with-freetype2-includes=PATH
+    - CMake 2.8.8 or newer
+    - FreeType 2.0.5 or newer
+    - Qt 4.8.x or 5.x (for xpdf only)
+    - libpng (for pdftoppm and pdftohtml)
+    - zlib (for pdftoppm and pdftohtml)
 
-* If you have Motif (or Lesstif) installed in a non-standard place,
-  you can use the following options to tell configure where to find
-  it:
+  If Qt isn't found, the GUI viewer (xpdf) won't be built, but the
+  command line tools will still be built.
 
-    --with-Xm-library=PATH
-    --with-Xm-includes=PATH
+* Create a build directory.  These instructions assume that you create
+  a directory called "build" under the top-level xpdf source
+  directory, but the build directory can be anywhere you like.  Create
+  the directory and cd into it:
 
-* Run the configure script:
+      cd ..../xpdf-X.YY
+      mkdir build
+      cd build
 
-    ./configure
+* Run cmake:
 
-  This should produce a set of makefiles customized for your system.
-  The configure script accepts the following options (in addition to
-  the usual things accepted by autoconf configure scripts):
+      cmake -DCMAKE_BUILD_TYPE=Release {other options - see below} ..
 
-    --prefix=PREFIX
-        Changes the directory where xpdf is installed.  The default is
-        /usr/local.
+  If your build directory isn't under the source, use the full path to
+  the source directory:
 
-    --enable-a4-paper
-        Switches the default paper size for PostScript output (xpdf
-        and pdftops) to A4.  The default is Letter size.
+      cmake -DCMAKE_BUILD_TYPE=Release {other options} ..../xpdf-X.YY
 
-    --enable-no-text-select
-        With this option, xpdf will not copy text.  (This is only
-        useful on closed systems where the user can't get at the PDF
-        file directly.)
+* If cmake doesn't find FreeType, you can set FREETYPE_DIR to point to
+  the FreeType install directory.  Add this to the cmake command line:
 
-    --enable-opi
-        Enables support for generation of OPI (Open Prepress
-        Interface) comments with pdftops.
+      -DFREETYPE_DIR=/opt/freetype
 
-    --sysconfdir=DIR
-        Look for the system-wide xpdfrc config file in this directory.
-        The default is PREFIX/etc.
+  Cmake will look for ${FREETYPE_DIR}/include.
 
-    --with-appdef-dir=DIR
-        Use the specified app-defaults directory.  The default is
-        /usr/lib/X11/app-defaults.
+  You can also set the FreeType library location with:
 
-  If you need to pass specific options to the C and/or C++ compiler,
-  you can set the CFLAGS and/or CXXFLAGS environment variables before
-  running the configure script.  Any options given that way will be
-  added to the CFLAGS/CXXFLAGS used by all of the Xpdf makefiles.
+      -DFREETYPE_LIBRARY=/opt/freetype/lib/libfreetype.so
 
-* Type 'make'.  This should build the executables:
+* If cmake doesn't find Qt, make sure qmake is on your executable
+  search path.
 
-    xpdf/xpdf
-    xpdf/pdftops
-    xpdf/pdftotext
-    xpdf/pdfinfo
-    xpdf/pdffonts
-    xpdf/pdfdetach
-    xpdf/pdftoppm
-    xpdf/pdfimages
+* To change the xpdf install directory, use:
 
-* If desired, type 'make install' to install the binaries and man
-  pages.
+      -DCMAKE_INSTALL_PREFIX=/opt/xpdf
 
-The old Makefile.config and Makefiles are no longer provided or
-supported.  If you really want to manually configure Xpdf (which is
-not recommended), the files that need to be created are aconf.h,
-Makefile, goo/Makefile, fofi/Makefile, splash/Makefile, and
-xpdf/Makefile, all of which are generated from the corresponding '.in'
-files.
+  If you're familiar with autoconf, this is similar to the "--prefix"
+  option.
 
-If you want to run a quick test, there is a tiny PDF file included
-with xpdf, as misc/hello.pdf .
+* Other configuration options are:
 
+    -DSPLASH_CMYK=ON
+        Enable CMYK rasterization support.
 
-**************
-***  OS/2  ***
-**************
+    -DA4_PAPER=ON
+        Switches the default paper size for PostScript output (xpdf
+        and pdftops) to A4.  The default is Letter size.
 
-Xpdf is known to run under OS/2 with the EMX runtime environment and
-XFree86.  Using a proper autoconf port you can generate a valid
-configure script version.
+    -DNO_TEXT_SELECT=ON
+        With this option, xpdf will not copy text.  (This is only
+        useful on closed systems where the user can't get at the PDF
+        file directly.)
 
+    -DOPI_SUPPORT=ON
+        Enables support for generation of OPI (Open Prepress
+        Interface) comments with pdftops.
 
-***************
-***  Win32  ***
-***************
+    -DMULTITHREADED=0
+        Disables multithreading, which also disables building the GUI
+        viewer (xpdf).  This does not affect the command line tools.
+        Disabling multithreading should only be necessary if you're
+        building with a compiler other than gcc, clang, or Microsoft
+        Visual Studio.
 
-The non-X programs (pdftops, pdftotext, pdfinfo, pdffonts, pdfdetach,
-pdfimages, and pdftoppm) will compile with both gcc (from cygwin),
-djgpp (the Delorie port of gcc) and Microsoft Visual C++.
+    -DSYSTEM_XPDFRC="/etc/xpdfrc"
+        Look for a system-wide xpdfrc config file in this directory.
 
-With cygwin, the build procedure is the same as for Unix:
+     -DCMAKE_DISABLE_FIND_PACKAGE_Qt4=1
+     -DCMAKE_DISABLE_FIND_PACKAGE_Qt5Widgets=1
+        Do not search for the Qt4/Qt5 libraries.  This will disable
+        building the GUI viewer (xpdf).
 
-  * Open a shell.
+     -DCMAKE_C_FLAGS="..."
+     -DCMAKE_CXX_FLAGS="..."
+        Set additional options to pass to the C and/or C++ compilers.
 
-  * ./configure
+     -DCMAKE_EXE_LINKER_FLAGS="..."
+        Set additional options to pass to the linker.
 
-  * make
+* Build:
 
-  * make install
+      make
 
-It is also possible to build the Xpdf viewer with the cygwin XFree86
-port (thanks to Michael A. Richmond for these instructions):
+  This will build the executables in the build directory:
 
-  * make sure you have the lesstif, XFree86-base, and XFree86-prog
-    cygwin packages installed (all from the "XFree86" category)
+      xpdf/xpdf
+      xpdf/pdftops
+      xpdf/pdftotext
+      xpdf/pdftohtml
+      xpdf/pdfinfo
+      xpdf/pdffonts
+      xpdf/pdfdetach
+      xpdf/pdftoppm
+      xpdf/pdftopng
+      xpdf/pdfimages
+      xpdf-qt/xpdf
 
-  * to build xpdf:
-    - cd xpdf-x.yy
-    - ./configure
-        --with-freetype2-library=/usr/lib
-        --with-freetype2-includes=/usr/include/freetype2
-        --with-Xm-library=/usr/lib
-        --with-Xm-includes=/usr/include
-      (all on one line)
-    - make
-    (this should build xpdf.exe, in addition to the command line
-    utilities)
+* If desired, install the binaries and man pages:
 
-With djgpp:
+      make install
 
-  * Open a DOS window.
+If you want to run a quick test, there is a tiny PDF file included
+with xpdf, as misc/hello.pdf .
 
-  * ./dj_make
 
-  * djgpp is a DOS/Windows port of gcc, available from
-    http://www.delorie.com/
+*****************
+***  Windows  ***
+*****************
 
-With djgpp, for DOS 6 (instead of Win32):
+The Windows build procedure is essentially the same as for Unix.  If
+building with cygwin, the procedure is identical to Unix.
 
-  * ./dj_make
+If building with Visual Studio:
 
-  * cd xpdf
+* Make sure you have CMake, FreeType, libpng, and zlib installed.
 
-  * strip pdftops.exe
+* You'll need to set the FREETYPE_DIR variable to point to your
+  FreeType installation, CMAKE_INCLUDE_PATH to point to your libpng
+  includes, CMAKE_LIBRARY_PATH to point to your libpng library, and
+  ZLIB_ROOT to point to your zlib installation.
 
-  * exe2coff pdftops.exe
+      cmake -G "NMake Makefiles"
+            -DCMAKE_BUILD_TYPE=Release
+            -DFREETYPE_DIR="c:/software/freetype"
+            -DCMAKE_INCLUDE_PATH="c:/software/libpng"
+            -DCMAKE_LIBRARY_PATH="c:/software/libpng"
+            -DZLIB_ROOT="c:/software/zlib"
+            ..
 
-  * copy /B c:\djgpp\bin\cwsdstub.exe+pdftops pdftops.exe
+* Build:
 
-  * upx pdftops.exe
-    - if you want compressed executables
-
-  * and similarly for the other executables
-
-  * cwsdstub.exe comes from djgpp/v2misc/csdpmi5b.zip on any of the
-    djgpp ftp mirrors; exe2coff is part of the standard djgpp install
-
-  * upx comes from http://upx.sourceforge.net/
-
-With the Microsoft tools:
-
-  * Open a DOS window.
-
-  * Type "cl".  If you get the message "Bad command or file name", you
-    must run VCVARS32.BAT. (The location of this BAT file can be
-    determined with Explorer.)
-
-  * Type "ms_make"
-
-The dj_make and ms_make scripts don't build pdftoppm -- you'll need to
-install FreeType 2 before you can compile pdftoppm.
+      nmake

Deleted: branches/stable/source/src/libs/xpdf/xpdf-src/Makefile.in
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/Makefile.in	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/Makefile.in	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,134 +0,0 @@
-#========================================================================
-#
-# Main xpdf Makefile.
-#
-# Copyright 1996-2003 Glyph & Cog, LLC
-#
-#========================================================================
-
-SHELL = /bin/sh
-
-DESTDIR =
-
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-srcdir = @srcdir@
-
-INSTALL = @INSTALL@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_DATA = @INSTALL_DATA@
-
-EXE = @EXE@
-
-all:
-	cd goo; $(MAKE)
-	cd @UP_DIR at fofi; $(MAKE)
-	cd @UP_DIR at splash; $(MAKE)
-	cd @UP_DIR at xpdf; $(MAKE) @XPDF_TARGET@
-
-all-no-x:
-	cd goo; $(MAKE)
-	cd @UP_DIR at fofi; $(MAKE)
-	cd @UP_DIR at xpdf; $(MAKE) all-no-x
-
-xpdf: dummy
-	cd goo; $(MAKE)
-	cd @UP_DIR at fofi; $(MAKE)
-	cd @UP_DIR at splash; $(MAKE)
-	cd @UP_DIR at xpdf; $(MAKE) xpdf$(EXE)
-
-pdftops: dummy
-	cd goo; $(MAKE)
-	cd @UP_DIR at fofi; $(MAKE)
-	cd @UP_DIR at splash; $(MAKE)
-	cd @UP_DIR at xpdf; $(MAKE) pdftops$(EXE)
-
-pdftotext: dummy
-	cd goo; $(MAKE)
-	cd @UP_DIR at fofi; $(MAKE)
-	cd @UP_DIR at splash; $(MAKE)
-	cd @UP_DIR at xpdf; $(MAKE) pdftotext$(EXE)
-
-pdfinfo:
-	cd goo; $(MAKE)
-	cd @UP_DIR at fofi; $(MAKE)
-	cd @UP_DIR at splash; $(MAKE)
-	cd @UP_DIR at xpdf; $(MAKE) pdfinfo$(EXE)
-
-pdffonts:
-	cd goo; $(MAKE)
-	cd @UP_DIR at fofi; $(MAKE)
-	cd @UP_DIR at splash; $(MAKE)
-	cd @UP_DIR at xpdf; $(MAKE) pdffonts$(EXE)
-
-pdfdetach:
-	cd goo; $(MAKE)
-	cd @UP_DIR at fofi; $(MAKE)
-	cd @UP_DIR at splash; $(MAKE)
-	cd @UP_DIR at xpdf; $(MAKE) pdfdetach$(EXE)
-
-pdftoppm:
-	cd goo; $(MAKE)
-	cd @UP_DIR at fofi; $(MAKE)
-	cd @UP_DIR at splash; $(MAKE)
-	cd @UP_DIR at xpdf; $(MAKE) pdftoppm$(EXE)
-
-pdfimages:
-	cd goo; $(MAKE)
-	cd @UP_DIR at fofi; $(MAKE)
-	cd @UP_DIR at splash; $(MAKE)
-	cd @UP_DIR at xpdf; $(MAKE) pdfimages$(EXE)
-
-dummy:
-
-install: dummy
-	-mkdir -p $(DESTDIR)@bindir@
- at X@	$(INSTALL_PROGRAM) xpdf/xpdf$(EXE) $(DESTDIR)@bindir@/xpdf$(EXE)
-	$(INSTALL_PROGRAM) xpdf/pdftops$(EXE) $(DESTDIR)@bindir@/pdftops$(EXE)
-	$(INSTALL_PROGRAM) xpdf/pdftotext$(EXE) $(DESTDIR)@bindir@/pdftotext$(EXE)
-	$(INSTALL_PROGRAM) xpdf/pdfinfo$(EXE) $(DESTDIR)@bindir@/pdfinfo$(EXE)
-	$(INSTALL_PROGRAM) xpdf/pdffonts$(EXE) $(DESTDIR)@bindir@/pdffonts$(EXE)
-	$(INSTALL_PROGRAM) xpdf/pdfdetach$(EXE) $(DESTDIR)@bindir@/pdfdetach$(EXE)
- at X@	$(INSTALL_PROGRAM) xpdf/pdftoppm$(EXE) $(DESTDIR)@bindir@/pdftoppm$(EXE)
-	$(INSTALL_PROGRAM) xpdf/pdfimages$(EXE) $(DESTDIR)@bindir@/pdfimages$(EXE)
-	-mkdir -p $(DESTDIR)@mandir@/man1
- at X@	$(INSTALL_DATA) $(srcdir)/doc/xpdf.1 $(DESTDIR)@mandir@/man1/xpdf.1
-	$(INSTALL_DATA) $(srcdir)/doc/pdftops.1 $(DESTDIR)@mandir@/man1/pdftops.1
-	$(INSTALL_DATA) $(srcdir)/doc/pdftotext.1 $(DESTDIR)@mandir@/man1/pdftotext.1
-	$(INSTALL_DATA) $(srcdir)/doc/pdfinfo.1 $(DESTDIR)@mandir@/man1/pdfinfo.1
-	$(INSTALL_DATA) $(srcdir)/doc/pdffonts.1 $(DESTDIR)@mandir@/man1/pdffonts.1
-	$(INSTALL_DATA) $(srcdir)/doc/pdfdetach.1 $(DESTDIR)@mandir@/man1/pdfdetach.1
- at X@	$(INSTALL_DATA) $(srcdir)/doc/pdftoppm.1 $(DESTDIR)@mandir@/man1/pdftoppm.1
-	$(INSTALL_DATA) $(srcdir)/doc/pdfimages.1 $(DESTDIR)@mandir@/man1/pdfimages.1
-	-mkdir -p $(DESTDIR)@mandir@/man5
-	$(INSTALL_DATA) $(srcdir)/doc/xpdfrc.5 $(DESTDIR)@mandir@/man5/xpdfrc.5
-	-mkdir -p $(DESTDIR)@sysconfdir@
-	@if test ! -f $(DESTDIR)@sysconfdir@/xpdfrc; then \
-		echo "$(INSTALL_DATA) $(srcdir)/doc/sample-xpdfrc $(DESTDIR)@sysconfdir@/xpdfrc"; \
-		$(INSTALL_DATA) $(srcdir)/doc/sample-xpdfrc $(DESTDIR)@sysconfdir@/xpdfrc; \
-	else \
-		echo "# not overwriting the existing $(DESTDIR)@sysconfdir@/xpdfrc"; \
-	fi
-
-clean:
-	-cd goo; $(MAKE) clean
-	-cd @UP_DIR at fofi; $(MAKE) clean
-	-cd @UP_DIR at splash; $(MAKE) clean
-	-cd @UP_DIR at xpdf; $(MAKE) clean
-
-distclean: clean
-	rm -f config.log config.status config.cache
-	rm -f aconf.h
-	rm -f Makefile goo/Makefile fofi/Makefile splash/Makefile xpdf/Makefile
-	rm -f goo/Makefile.dep fofi/Makefile.dep splash/Makefile.dep xpdf/Makefile.dep
-	rm -f goo/Makefile.in.bak fofi/Makefile.in.bak splash/Makefile.in.bak xpdf/Makefile.in.bak
-	touch goo/Makefile.dep
-	touch fofi/Makefile.dep
-	touch splash/Makefile.dep
-	touch xpdf/Makefile.dep
-
-depend:
-	cd goo; $(MAKE) depend
-	cd @UP_DIR at fofi; $(MAKE) depend
-	cd @UP_DIR at splash; $(MAKE) depend
-	cd @UP_DIR at xpdf; $(MAKE) depend

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/README
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/README	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/README	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,17 +1,17 @@
 Xpdf
 ====
 
-version 3.04
-2014-may-28
+version 4.00
+2017-aug-10
 
 The Xpdf software and documentation are
-copyright 1996-2014 Glyph & Cog, LLC.
+copyright 1996-2017 Glyph & Cog, LLC.
 
-Email: derekn at foolabs.com
-WWW: http://www.foolabs.com/xpdf/
+Email: xpdf at xpdfreader.com
+WWW: http://www.xpdfreader.com/
 
 The PDF data structures, operators, and specification are
-copyright 1985-2006 Adobe Systems Inc.
+documented in ISO 32000-1:2008.
 
 
 What is Xpdf?
@@ -23,16 +23,14 @@
 PDF text extractor, PDF-to-PostScript converter, and various other
 utilities.
 
-Xpdf runs under the X Window System on UNIX and OS/2.  The non-X
-components (pdftops, pdftotext, etc.) also run on Windows and Mac OSX
-systems and should run on pretty much any system with a decent C++
-compiler.  Xpdf will run on 32-bit and 64-bit machines.
+The Xpdf viewer uses the Qt cross-platform GUI toolkit.  The other
+command line utilties do not require Qt.
 
 
 License & Distribution
 ----------------------
 
-Xpdf is licensed under the GNU General Pulbic License (GPL), version 2
+Xpdf is licensed under the GNU General Public License (GPL), version 2
 or 3.  This means that you can distribute derivatives of Xpdf under
 any of the following:
   - GPL v2 only
@@ -64,18 +62,14 @@
 Compatibility
 -------------
 
-Xpdf is developed and tested on Linux.
+Xpdf uses the Qt toolkit and runs on Linux, Windows, and OS X -- and
+probably other systems that have a Qt port.
 
-In addition, it has been compiled by others on Solaris, AIX, HP-UX,
-Digital Unix, Irix, and numerous other Unix implementations, as well
-as OS/2.  It should work on pretty much any system which runs X11 and
-has Unix-like libraries.  You'll need ANSI C++ and C compilers to
-compile it.
+The non-GUI command line utilities (pdftops, pdftotext, pdftohtml,
+pdfinfo, pdffonts, pdfdetach, pdftoppm, pdftopng, and pdfimages) run
+on Linux, Windows, and OS X -- and should run on pretty much any
+system with a decent C++ compiler.
 
-The non-X components of Xpdf (pdftops, pdftotext, pdfinfo, pdffonts,
-pdfdetach, pdftoppm, and pdfimages) can also be compiled on Windows
-and Mac OSX systems.  See the Xpdf web page for details.
-
 If you compile Xpdf for a system not listed on the web page, please
 let me know.  If you're willing to make your binary available by ftp
 or on the web, I'll be happy to add a link from the Xpdf web page.  I
@@ -85,21 +79,14 @@
 If you can't get Xpdf to compile on your system, send me email and
 I'll try to help.
 
-Xpdf has been ported to the Acorn, Amiga, BeOS, and EPOC.  See the
-Xpdf web page for links.
 
-
 Getting Xpdf
 ------------
 
 The latest version is available from:
 
-  http://www.foolabs.com/xpdf/
+  http://www.xpdfreader.com/
 
-or:
-
-  ftp://ftp.foolabs.com/pub/xpdf/
-
 Source code and several precompiled executables are available.
 
 Announcements of new versions are posted to comp.text.pdf and emailed
@@ -114,8 +101,7 @@
 
   xpdf file.pdf
 
-To generate a PostScript file, hit the "print" button in xpdf, or run
-pdftops:
+To generate a PostScript file, run pdftops:
 
   pdftops file.pdf
 
@@ -123,9 +109,10 @@
 
   pdftotext file.pdf
 
-There are five additional utilities (which are fully described in
+There are several additional utilities (which are fully described in
 their man pages):
 
+  pdftohtml -- converts a PDF file to HTML
   pdfinfo -- dumps a PDF file's Info dictionary (plus some other
              useful information)
   pdffonts -- lists the fonts used in a PDF file along with various
@@ -134,6 +121,7 @@
                PDF file
   pdftoppm -- converts a PDF file to a series of PPM/PGM/PBM-format
               bitmaps
+  pdftopng -- converts a PDF file to a series of PNG image files
   pdfimages -- extracts the images from a PDF file
 
 Command line options and many other details are described in the man
@@ -143,30 +131,6 @@
 xpdfrc(5) man page.
 
 
-Upgrading from Xpdf 3.02 (and earlier)
---------------------------------------
-
-The font configuration system has been changed.  Previous versions
-used mostly separate commands to configure fonts for display and for
-PostScript output.  As of 3.03, configuration options that make sense
-for both display and PS output have been unified.
-
-The following xpdfrc commands have been removed:
-* displayFontT1, displayFontTT: replaced with fontFile
-* displayNamedCIDFontT1, displayNamedCIDFontTT: replaced with fontFile
-* displayCIDFontT1, displayCIDFontTT: replaced with fontFileCC
-* psFont: replaced with psResidentFont
-* psNamedFont16: replaced with psResidentFont16
-* psFont16: replaced with psResidentFontCC
-
-See the xpdfrc(5) man page for more information on the new commands.
-
-Pdftops will now embed external 16-bit fonts (configured with the
-fontFileCC command) when the PDF file refers to a non-embedded font.
-It does not do any subsetting (yet), so the resulting PS files will be
-large.
-
-
 Compiling Xpdf
 --------------
 
@@ -187,7 +151,8 @@
 
 Xpdf uses the following libraries:
 * FreeType [http://www.freetype.org/]
-* libpng [http://www.libpng.com/pub/png/libpng.html] (used by pdftohtml)
+* libpng [http://www.libpng.com/pub/png/libpng.html] (used by pdftohtml
+  and pdftopng)
 * zlib [http://zlib.net/] (used by pdftohtml)
 
 
@@ -231,16 +196,21 @@
 References
 ----------
 
-Adobe Systems Inc., _PDF Reference, sixth edition: Adobe Portable
-Document Format version 1.7_.
+Adobe Systems Inc., ISO 32000-1:2008, Document Management - Portable
+document format - Part 1: PDF 1.7.
 http://www.adobe.com/devnet/pdf/pdf_reference.html
 [The manual for PDF version 1.7.]
 
-Adobe Systems Inc., "Errata for the PDF Reference, sixth edition,
-version 1.7", October 16, 2006.
+Adobe Systems Inc., Adobe Supplement to the ISO 32000, BaseVersion
+1.7, ExtensionLevel 3, June 2008.
 http://www.adobe.com/devnet/pdf/pdf_reference.html
-[The errata for the PDF 1.7 spec.]
+[Additions to the PDF 1.7 spec.]
 
+Adobe Systems Inc., Adobe Supplement to ISO 32000-1, BaseVersion 1.7,
+ExtensionLevel 5, June 2009.
+http://www.adobe.com/devnet/pdf/pdf_reference.html
+[Additions to the PDF 1.7 spec.]
+
 Adobe Systems Inc., _PostScript Language Reference_, 3rd ed.
 Addison-Wesley, 1999, ISBN 0-201-37922-8.
 [The official PostScript manual.]

Deleted: branches/stable/source/src/libs/xpdf/xpdf-src/aclocal.m4
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/aclocal.m4	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/aclocal.m4	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,274 +0,0 @@
-# <<< smr.m4 from smr_macros 0.2.4 >>>
-
-dnl ####################### -*- Mode: M4 -*- ###########################
-dnl smr.m4 -- 
-dnl 
-dnl Copyright (C) 1999 Matthew D. Langston <langston at SLAC.Stanford.EDU>
-dnl Copyright (C) 1998 Steve Robbins <stever at cs.mcgill.ca>
-dnl
-dnl This file is free software; you can redistribute it and/or modify it
-dnl under the terms of the GNU General Public License as published by
-dnl the Free Software Foundation; either version 2 of the License, or
-dnl (at your option) any later version.
-dnl
-dnl This file is distributed in the hope that it will be useful, but
-dnl WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-dnl General Public License for more details.
-dnl
-dnl You should have received a copy of the GNU General Public License
-dnl along with this file; if not, write to:
-dnl
-dnl   Free Software Foundation, Inc.
-dnl   Suite 330
-dnl   59 Temple Place
-dnl   Boston, MA 02111-1307, USA.
-dnl ####################################################################
-
-
-dnl NOTE: The macros in this file are extensively documented in the
-dnl       accompanying `smr_macros.texi' Texinfo file.  Please see the
-dnl       Texinfo documentation for the definitive specification of how
-dnl       these macros are supposed to work.  If the macros work
-dnl       differently than the Texinfo documentation says they should,
-dnl       then the macros (and not the Texinfo documentation) has the
-dnl       bug(s).
-
-dnl This is a convenient macro which translates illegal characters for
-dnl bourne shell variables into legal characters.  It has the same
-dnl functionality as sed 'y%./+-:%__p__%'.
-AC_DEFUN([smr_safe_translation], [patsubst(patsubst([$1], [+], [p]), [./-:], [_])])
-
-AC_DEFUN(smr_SWITCH,
-[
-  dnl Define convenient aliases for the arguments since there are so
-  dnl many of them and I keep confusing myself whenever I have to edit
-  dnl this macro.
-  pushdef([smr_name],        $1)
-  pushdef([smr_help_string], $2)
-  pushdef([smr_default],     $3)
-  pushdef([smr_yes_define],  $4)
-  pushdef([smr_no_define],   $5)
-
-  dnl Do some sanity checking of the arguments.
-  ifelse([regexp(smr_default, [^\(yes\|no\)$])], -1, [AC_MSG_ERROR($0: third arg must be either yes or no)])
-
-  dnl Create the help string
-  pushdef([smr_lhs], [--ifelse(smr_default, yes, disable, enable)-smr_name])dnl
-  pushdef([smr_rhs], [ifelse(smr_default, yes, disable, enable) smr_help_string (default is smr_default)])dnl
-
-  dnl Add the option to `configure --help'.  We don't need to supply the
-  dnl 4th argument to AC_ARG_ENABLE (i.e. the code to set the default
-  dnl value) because that is done below by AC_CACHE_CHECK.
-  AC_ARG_ENABLE([smr_name],
-                AC_HELP_STRING([smr_lhs], [smr_rhs]),
-                smr_cv_enable_[]smr_name=$enableval)
-
-  dnl We cache the result so that the user doesn't have to remember
-  dnl which flags they passed to `configure'.
-  AC_CACHE_CHECK([whether to enable smr_help_string],
-                 smr_cv_enable_[]smr_name,
-                 smr_cv_enable_[]smr_name=smr_default)
-
-    ifelse(smr_yes_define, , , test x"[$]smr_cv_enable_[]smr_name" = xyes && AC_DEFINE(smr_yes_define))
-    ifelse(smr_no_define, , ,  test x"[$]smr_cv_enable_[]smr_name" = xno  && AC_DEFINE(smr_no_define))
-
-  dnl Sanity check the value assigned to smr_cv_enable_$1 to force it to
-  dnl be either `yes' or `no'.
-  if test ! x"[$]smr_cv_enable_[]smr_name" = xyes; then
-    if test ! x"[$]smr_cv_enable_[]smr_name" = xno; then
-      AC_MSG_ERROR([smr_lhs must be either yes or no])
-    fi
-  fi
-
-  popdef([smr_name])
-  popdef([smr_help_string])
-  popdef([smr_default])
-  popdef([smr_yes_define])
-  popdef([smr_no_define])
-  popdef([smr_lhs])
-  popdef([smr_rhs])
-])
-
-
-AC_DEFUN(smr_ARG_WITHLIB,
-[
-  dnl Define convenient aliases for the arguments since there are so
-  dnl many of them and I keep confusing myself whenever I have to edit
-  dnl this macro.
-  pushdef([smr_name],        $1)
-  pushdef([smr_libname],     ifelse($2, , smr_name, $2))
-  pushdef([smr_help_string], $3)
-  pushdef([smr_safe_name],   smr_safe_translation(smr_name))
-
-  dnl Add the option to `configure --help'.  We don't need to supply the
-  dnl 4th argument to AC_ARG_WITH (i.e. the code to set the default
-  dnl value) because that is done below by AC_CACHE_CHECK.
-  AC_ARG_WITH(smr_safe_name-library,
-              AC_HELP_STRING([--with-smr_safe_name-library[[=PATH]]],
-                             [use smr_name library ifelse(smr_help_string, , , (smr_help_string))]),
-              smr_cv_with_[]smr_safe_name[]_library=$withval)
-
-  dnl We cache the result so that the user doesn't have to remember
-  dnl which flags they passed to `configure'.
-  AC_CACHE_CHECK([whether to use smr_name library],
-                 smr_cv_with_[]smr_safe_name[]_library,
-                 smr_cv_with_[]smr_safe_name[]_library=maybe)
-
-
-  case x"[$]smr_cv_with_[]smr_safe_name[]_library" in
-      xyes | xmaybe)
-          smr_safe_name[]_LIBS="-l[]smr_libname"
-          with_[]smr_safe_name=[$]smr_cv_with_[]smr_safe_name[]_library
-          ;;
-      xno)
-          smr_safe_name[]_LIBS=
-          with_[]smr_safe_name=no
-          ;;
-      *)
-          if test -f "[$]smr_cv_with_[]smr_safe_name[]_library"; then
-            smr_safe_name[]_LIBS=[$]smr_cv_with_[]smr_safe_name[]_library
-          elif test -d "[$]smr_cv_with_[]smr_safe_name[]_library"; then
-            smr_safe_name[]_LIBS="-L[$]smr_cv_with_[]smr_safe_name[]_library -l[]smr_libname"
-          else
-            AC_MSG_ERROR([argument must be boolean, file, or directory])
-          fi
-          with_[]smr_safe_name=yes
-          ;;
-  esac
-
-  popdef([smr_name])
-  popdef([smr_libname])
-  popdef([smr_help_string])
-  popdef([smr_safe_name])
-])
-
-
-AC_DEFUN(smr_ARG_WITHINCLUDES,
-[
-  dnl Define convenient aliases for the arguments since there are so
-  dnl many of them and I keep confusing myself whenever I have to edit
-  dnl this macro.
-  pushdef([smr_name],        $1)
-  pushdef([smr_header],      $2)
-  pushdef([smr_extra_flags], $3)
-  pushdef([smr_safe_name],   smr_safe_translation(smr_name))
-
-  dnl Add the option to `configure --help'.  We don't need to supply the
-  dnl 4th argument to AC_ARG_WITH (i.e. the code to set the default
-  dnl value) because that is done below by AC_CACHE_CHECK.
-  AC_ARG_WITH(smr_safe_name-includes,
-              AC_HELP_STRING([--with-smr_safe_name-includes[[=DIR]]],
-                             [set directory for smr_name headers]),
-              smr_cv_with_[]smr_safe_name[]_includes=$withval)
-
-  dnl We cache the result so that the user doesn't have to remember
-  dnl which flags they passed to `configure'.
-  AC_CACHE_CHECK([where to find the smr_name header files],
-                 smr_cv_with_[]smr_safe_name[]_includes,
-                 smr_cv_with_[]smr_safe_name[]_includes=)
-
-  if test ! x"[$]smr_cv_with_[]smr_safe_name[]_includes" = x; then
-    if test -d "[$]smr_cv_with_[]smr_safe_name[]_includes"; then
-      smr_safe_name[]_CFLAGS="-I[$]smr_cv_with_[]smr_safe_name[]_includes"
-    else
-      AC_MSG_ERROR([argument must be a directory])
-    fi
-  else
-    smr_safe_name[]_CFLAGS=
-  fi
-
-  dnl This bit of logic comes from the autoconf AC_PROG_CC macro.  We
-  dnl need to put the given include directory into CPPFLAGS temporarily,
-  dnl but then restore CPPFLAGS to its old value.
-  smr_test_CPPFLAGS="${CPPFLAGS+set}"
-  smr_save_CPPFLAGS="$CPPFLAGS"
-  CPPFLAGS="$CPPFLAGS [$]smr_safe_name[]_CFLAGS smr_extra_flags"
-
-  dnl If the header file smr_header exists, then define
-  dnl HAVE_[]smr_header (in all capitals).
-  AC_CHECK_HEADERS([smr_header],
-                   smr_have_[]smr_safe_name[]_header=yes,
-                   smr_have_[]smr_safe_name[]_header=no)
-
-  if test x"$smr_test_CPPFLAGS" = xset; then
-    CPPFLAGS=$smr_save_CPPFLAGS
-  else
-    unset CPPFLAGS
-  fi
-
-  popdef([smr_name])
-  popdef([smr_header])
-  popdef([smr_extra_flags])
-  popdef([smr_safe_name])
-])
-
-
-AC_DEFUN(smr_CHECK_LIB,
-[
-  dnl Define convenient aliases for the arguments since there are so
-  dnl many of them and I keep confusing myself whenever I have to edit
-  dnl this macro.
-  pushdef([smr_name],        $1)
-  pushdef([smr_libname],     ifelse($2, , smr_name, $2))
-  pushdef([smr_help_string], $3)
-  pushdef([smr_function],    $4)
-  pushdef([smr_header],      $5)
-  pushdef([smr_extra_libs],  $6)
-  pushdef([smr_extra_flags], $7)
-  pushdef([smr_prototype],   $8)
-  pushdef([smr_safe_name],   smr_safe_translation(smr_name))
-
-  dnl Give the user (via "configure --help") an interface to specify
-  dnl whether we should use the library or not, and possibly where we
-  dnl should find it.
-  smr_ARG_WITHLIB([smr_name], [smr_libname], [smr_help_string])
-
-  if test ! x"$with_[]smr_safe_name" = xno; then
-
-    # If we got this far, then the user didn't explicitly ask not to use
-    # the library.
-
-    dnl If the caller of smr_CHECK_LIB specified a header file for this
-    dnl library, then give the user (via "configure --help") an
-    dnl interface to specify where this header file can be found (if it
-    dnl isn't found by the compiler by default).
-    ifelse(smr_header, , , [smr_ARG_WITHINCLUDES(smr_name, smr_header, smr_extra_flags)])
-
-    # We need only look for the library if the header has been found
-    # (or no header is needed).
-    if test [$]smr_have_[]smr_safe_name[]_header != no; then
-
-       AC_CHECK_LIB(smr_libname,
-                    smr_function,
-                    smr_have_[]smr_safe_name[]_library=yes,
-                    smr_have_[]smr_safe_name[]_library=no,
-                    [$]smr_safe_name[]_CFLAGS [smr_extra_flags] [$]smr_safe_name[]_LIBS [smr_extra_libs],
-                    [ifelse(smr_prototype, , , [[#]include <smr_header>])],
-                    smr_prototype)
-    fi
-
-    if test x"[$]smr_have_[]smr_safe_name[]_library" = xyes; then
-      AC_MSG_RESULT([using smr_name library])
-    else
-      smr_safe_name[]_LIBS=
-      smr_safe_name[]_CFLAGS=
-
-      if test x"$with_[]smr_safe_name" = xmaybe; then
-        AC_MSG_RESULT([not using smr_name library])
-      else
-        AC_MSG_WARN([requested smr_name library not found!])
-      fi
-    fi
-  fi
-
-  popdef([smr_name])
-  popdef([smr_libname])
-  popdef([smr_help_string])
-  popdef([smr_function])
-  popdef([smr_header])
-  popdef([smr_extra_libs])
-  popdef([smr_extra_flags])
-  popdef([smr_prototype])
-  popdef([smr_safe_name])
-])

Deleted: branches/stable/source/src/libs/xpdf/xpdf-src/aconf-dj.h
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/aconf-dj.h	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/aconf-dj.h	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,73 +0,0 @@
-/*
- * aconf-dj.h
- *
- * Copyright 2002-2003 Glyph & Cog, LLC
- */
-
-#ifndef ACONF_H
-#define ACONF_H
-
-/*
- * Use A4 paper size instead of Letter for PostScript output.
- */
-#undef A4_PAPER
-
-/*
- * Do not allow text selection.
- */
-#undef NO_TEXT_SELECT
-
-/*
- * Include support for OPI comments.
- */
-#undef OPI_SUPPORT
-
-/*
- * Directory with the Xpdf app-defaults file.
- */
-#undef APPDEFDIR
-
-/*
- * Full path for the system-wide xpdfrc file.
- */
-#undef SYSTEM_XPDFRC
-
-/*
- * Various include files and functions.
- */
-#define HAVE_DIRENT_H 1
-#undef HAVE_SYS_NDIR_H
-#undef HAVE_SYS_DIR_H
-#undef HAVE_NDIR_H
-#undef HAVE_SYS_SELECT_H
-#undef HAVE_SYS_BSDTYPES_H
-#undef HAVE_STRINGS_H
-#undef HAVE_BSTRING_H
-#define HAVE_POPEN 1
-#undef HAVE_MKSTEMP
-#undef SELECT_TAKES_INT
-#define HAVE_STD_SORT 1
-#undef HAVE_FSEEK64
-
-/*
- * This is defined if using libXpm.
- */
-#undef HAVE_X11_XPM_H
-
-/*
- * One of these is defined if using FreeType (version 1 or 2).
- */
-#undef HAVE_FREETYPE_H
-#undef HAVE_FREETYPE_FREETYPE_H
-
-/*
- * This is defined if using FreeType version 2.
- */
-#undef FREETYPE2
-
-/*
- * This is defined if using libpaper.
- */
-#undef HAVE_PAPER_H
-
-#endif

Deleted: branches/stable/source/src/libs/xpdf/xpdf-src/aconf-win32.h
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/aconf-win32.h	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/aconf-win32.h	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,112 +0,0 @@
-/*
- * aconf-win32.h
- *
- * Copyright 2002-2003 Glyph & Cog, LLC
- */
-
-#ifndef ACONF_H
-#define ACONF_H
-
-#include <aconf2.h>
-
-/*
- * Use A4 paper size instead of Letter for PostScript output.
- */
-#undef A4_PAPER
-
-/*
- * Do not allow text selection.
- */
-#undef NO_TEXT_SELECT
-
-/*
- * Include support for OPI comments.
- */
-#undef OPI_SUPPORT
-
-/*
- * Enable multithreading support.
- */
-#define MULTITHREADED 1
-
-/*
- * Enable C++ exceptions.
- */
-#define USE_EXCEPTIONS 1
-
-/*
- * Use fixed point (instead of floating point) arithmetic.
- */
-#undef USE_FIXEDPOINT
-
-/*
- * Directory with the Xpdf app-defaults file.
- */
-#undef APPDEFDIR
-
-/*
- * Full path for the system-wide xpdfrc file.
- */
-#undef SYSTEM_XPDFRC
-
-/*
- * Various include files and functions.
- */
-#undef HAVE_DIRENT_H
-#undef HAVE_SYS_NDIR_H
-#undef HAVE_SYS_DIR_H
-#undef HAVE_NDIR_H
-#undef HAVE_SYS_SELECT_H
-#undef HAVE_SYS_BSDTYPES_H
-#undef HAVE_STRINGS_H
-#undef HAVE_BSTRING_H
-#undef HAVE_POPEN
-#undef HAVE_MKSTEMP
-#undef HAVE_MKSTEMPS
-#undef SELECT_TAKES_INT
-#define HAVE_STD_SORT 1
-#undef HAVE_FSEEKO
-#undef HAVE_FSEEK64
-#define HAVE_FSEEKI64 1
-#undef _FILE_OFFSET_BITS
-#undef _LARGE_FILES
-#undef _LARGEFILE_SOURCE
-#undef HAVE_XTAPPSETEXITFLAG
-
-/*
- * This is defined if using libXpm.
- */
-#undef HAVE_X11_XPM_H
-
-/*
- * One of these is defined if using FreeType (version 1 or 2).
- */
-#undef HAVE_FREETYPE_H
-#define HAVE_FREETYPE_FREETYPE_H 1
-
-/*
- * This is defined if using FreeType version 2.
- */
-#define FREETYPE2
-
-/*
- * This is defined if using libpaper.
- */
-#undef HAVE_PAPER_H
-
-/*
- * Enable support for loading plugins.
- */
-#undef ENABLE_PLUGINS
-
-/*
- * Defined if the Splash library is avaiable.
- */
-#define HAVE_SPLASH 1
-
-/*
- * Enable support for CMYK output.
- */
-#define SPLASH_CMYK 1
-
-#endif

Deleted: branches/stable/source/src/libs/xpdf/xpdf-src/aconf.h.in
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/aconf.h.in	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/aconf.h.in	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,107 +0,0 @@
-/*
- * aconf.h
- *
- * Copyright 2002-2003 Glyph & Cog, LLC
- */
-
-#ifndef ACONF_H
-#define ACONF_H
-
-#include <aconf2.h>
-
-/*
- * Use A4 paper size instead of Letter for PostScript output.
- */
-#undef A4_PAPER
-
-/*
- * Do not allow text selection.
- */
-#undef NO_TEXT_SELECT
-
-/*
- * Include support for OPI comments.
- */
-#undef OPI_SUPPORT
-
-/*
- * Enable multithreading support.
- */
-#undef MULTITHREADED
-
-/*
- * Enable C++ exceptions.
- */
-#undef USE_EXCEPTIONS
-
-/*
- * Use fixed point (instead of floating point) arithmetic.
- */
-#undef USE_FIXEDPOINT
-
-/*
- * Directory with the Xpdf app-defaults file.
- */
-#undef APPDEFDIR
-
-/*
- * Full path for the system-wide xpdfrc file.
- */
-#undef SYSTEM_XPDFRC
-
-/*
- * Various include files and functions.
- */
-#undef HAVE_DIRENT_H
-#undef HAVE_SYS_NDIR_H
-#undef HAVE_SYS_DIR_H
-#undef HAVE_NDIR_H
-#undef HAVE_SYS_SELECT_H
-#undef HAVE_SYS_BSDTYPES_H
-#undef HAVE_STRINGS_H
-#undef HAVE_BSTRING_H
-#undef HAVE_POPEN
-#undef HAVE_MKSTEMP
-#undef HAVE_MKSTEMPS
-#undef SELECT_TAKES_INT
-#undef HAVE_STD_SORT
-#undef HAVE_FSEEKO
-#undef HAVE_FSEEK64
-#undef HAVE_FSEEKI64
-#undef _FILE_OFFSET_BITS
-#undef _LARGE_FILES
-#undef _LARGEFILE_SOURCE
-#undef HAVE_XTAPPSETEXITFLAG
-
-/*
- * This is defined if using libXpm.
- */
-#undef HAVE_X11_XPM_H
-
-/*
- * One of these is defined if using FreeType 2.
- */
-#undef HAVE_FREETYPE_H
-#undef HAVE_FREETYPE_FREETYPE_H
-
-/*
- * This is defined if using libpaper.
- */
-#undef HAVE_PAPER_H
-
-/*
- * Enable support for loading plugins.
- */
-#undef ENABLE_PLUGINS
-
-/*
- * Defined if the Splash library is avaiable.
- */
-#undef HAVE_SPLASH
-
-/*
- * Enable support for CMYK output.
- */
-#undef SPLASH_CMYK
-
-#endif

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/aconf2.h
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/aconf2.h	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/aconf2.h	2017-11-01 18:15:56 UTC (rev 780)
@@ -15,7 +15,7 @@
 /*
  * This controls the use of the interface/implementation pragmas.
  */
-#ifdef __GNUC__
+#if defined(__GNUC__) && !defined(__clang__)
 #define USE_GCC_PRAGMAS
 #endif
 /* There is a bug in the version of gcc which ships with MacOS X 10.2 */

Added: branches/stable/source/src/libs/xpdf/xpdf-src/cmake-config.txt
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/cmake-config.txt	                        (rev 0)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/cmake-config.txt	2017-11-01 18:15:56 UTC (rev 780)
@@ -0,0 +1,290 @@
+#========================================================================
+#
+# cmake-config.txt
+#
+# CMake script to do misc cmake config and platform-specific config.
+#
+# Copyright 2015 Glyph & Cog, LLC
+#
+#========================================================================
+
+include(CheckFunctionExists)
+include(CheckCXXSourceCompiles)
+
+enable_language(CXX)
+
+#--- set default C/C++ compiler flags for Unix
+#    and add a 'Profiling' build mode
+if (CMAKE_GENERATOR STREQUAL "Unix Makefiles")
+  if (CYGWIN)
+    set(PIC_FLAG "")
+  else ()
+    set(PIC_FLAG "-fPIC")
+  endif ()
+  set(CMAKE_C_FLAGS_DEBUG "-g -O -Wall ${PIC_FLAG}")
+  set(CMAKE_CXX_FLAGS_DEBUG "-g -O -Wall ${PIC_FLAG}")
+  set(CMAKE_EXE_LINKER_FLAGS_DEBUG "-g -O -Wall ${PIC_FLAG}")
+  set(CMAKE_C_FLAGS_RELEASE "-O3 -Wall ${PIC_FLAG}")
+  set(CMAKE_CXX_FLAGS_RELEASE "-O3 -Wall ${PIC_FLAG}")
+  set(CMAKE_EXE_LINKER_FLAGS_RELEASE "-O2 -Wall ${PIC_FLAG}")
+  set(CMAKE_C_FLAGS_PROFILING "-g -pg -O -Wall ${PIC_FLAG}"
+      CACHE STRING "C compiler flags for profiling mode")
+  set(CMAKE_CXX_FLAGS_PROFILING "-g -pg -O -Wall ${PIC_FLAG}"
+      CACHE STRING "C++ compiler flags for profiling mode")
+  set(CMAKE_EXE_LINKER_FLAGS_PROFILING "-g -pg -O -Wall ${PIC_FLAG}"
+      CACHE STRING "linker flags for profiling mode")
+  mark_as_advanced(
+    CMAKE_C_FLAGS_PROFILING
+    CMAKE_CXX_FLAGS_PROFILING
+    CMAKE_EXE_LINKER_FLAGS_PROFILING)
+  set(CMAKE_BUILD_TYPE "${CMAKE_BUILD_TYPE}" CACHE STRING
+      "Choose build mode - options are: None Debug Release RelWithDebInfo MinSiz
+eRel Profiling")
+endif ()
+
+#--- set default C/C++ compiler flags for Windows
+if (WIN32)
+  foreach (var CMAKE_C_FLAGS_DEBUG CMAKE_CXX_FLAGS_DEBUG
+               CMAKE_C_FLAGS_RELEASE CMAKE_CXX_FLAGS_RELEASE
+               CMAKE_C_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_MINSIZEREL
+               CMAKE_C_FLAGS_RELWITHDEBINFO CMAKE_CXX_FLAGS_RELWITHDEBINFO)
+    # note: this converts /MD to /MT and /MDd to /MTd
+    string(REGEX REPLACE "/MD" "/MT" ${var} "${${var}}")
+  endforeach ()
+  set(CMAKE_EXE_LINKER_FLAGS_DEBUG "/NODEFAULTLIB:libcmt ${CMAKE_EXE_LINKER_FLAGS_DEBUG}")
+  set(CMAKE_SHARED_LINKER_FLAGS_DEBUG "/NODEFAULTLIB:libcmt ${CMAKE_SHARED_LINKER_FLAGS_DEBUG}")
+  foreach (var CMAKE_C_FLAGS_DEBUG
+               CMAKE_C_FLAGS_RELEASE
+               CMAKE_C_FLAGS_MINSIZEREL
+               CMAKE_C_FLAGS_RELWITHDEBINFO)
+    set(${var} "${${var}} /D_CRT_SECURE_NO_WARNINGS /wd4290 /wd4996")
+  endforeach ()
+  foreach (var CMAKE_CXX_FLAGS_DEBUG
+               CMAKE_CXX_FLAGS_RELEASE
+               CMAKE_CXX_FLAGS_MINSIZEREL
+               CMAKE_CXX_FLAGS_RELWITHDEBINFO)
+    set(${var} "${${var}} /D_CRT_SECURE_NO_WARNINGS /wd4290 /wd4996 /EHsc")
+  endforeach ()
+endif ()
+
+#--- don't set an rpath
+set(CMAKE_SKIP_RPATH FALSE)
+
+#--- miscellaneous options
+option(A4_PAPER "use A4 (instead of Letter) paper size by default for PostScript output" OFF)
+option(NO_TEXT_SELECT "do not allow text selection" OFF)
+option(OPI_SUPPORT "include support for OPI comments" OFF)
+option(MULTITHREADED "include support for multithreading" ON)
+option(USE_EXCEPTIONS "use C++ exceptions" ON)
+option(USE_FIXEDPOINT "use fixed point (instead of floating point) arithmetic" OFF)
+option(SPLASH_CMYK "include support for CMYK rasterization" OFF)
+option(SPLASH_DEVICEN "include support for DeviceN rasterization" OFF)
+if (SPLASH_DEVICEN)
+  set(SPLASH_CMYK ON)
+endif ()
+option(USE_LCMS "enable color management using lcms2" OFF)
+option(HIGHLIGHTED_REGIONS "include support for highlighted regions" OFF)
+option(SYSTEM_XPDFRC "full path for system-wide xpdfrc file" "")
+if (SYSTEM_XPDFRC)
+  set(SYSTEM_XPDFRC_DEFINE "#define SYSTEM_XPDFRC \"${SYSTEM_XPDFRC}\"")
+else ()
+  set(SYSTEM_XPDFRC_DEFINE "/* #undef SYSTEM_XPDFRC */")
+endif ()
+option(XPDFWIDGET_PRINTING "include printing support in XpdfWidget" OFF)
+option(EVAL_MODE "enable evaluation mode" OFF)
+option(BUILDING_XPDFREADER "enable closed source XpdfReader build" OFF)
+
+#--- check for various library functions
+check_function_exists(mkstemp HAVE_MKSTEMP)
+check_function_exists(mkstemps HAVE_MKSTEMPS)
+check_function_exists(popen HAVE_POPEN)
+check_cxx_source_compiles(
+    "#include <algorithm>
+    bool cmp(const int &x, const int &y) { return x < y; }
+    int a[100];
+    int main() { std::sort(a, a+100, &cmp); }"
+  HAVE_STD_SORT)
+
+#--- set up 64-bit file seeks
+check_function_exists(fseeko HAVE_FSEEKO)
+check_function_exists(fseek64 HAVE_FSEEK64)
+check_function_exists(_fseeki64 HAVE_FSEEKI64)
+
+#--- look for FreeType
+# This could use cmake's FindFreetype, except that it would require
+# a newer version of cmake -- because FreeType changed their include
+# paths around.  Older versions of FreeType require two separate
+# -I switches (typically ..../include and ..../include/freetype2);
+# while newer versions require just one (typically ..../include/freetype2)
+find_path(FREETYPE_INCLUDE_DIR_ft2build ft2build.h
+  HINTS
+  ${FREETYPE_DIR}
+  PATHS
+  /usr/local/include
+  /usr/local/X11R6/include
+  /usr/local/X11/include
+  /usr/freeware/include
+  PATH_SUFFIXES freetype2 include/freetype2 include
+)
+find_path(FREETYPE_INCLUDE_DIR_freetype freetype.h
+  HINTS
+  ${FREETYPE_DIR}
+  PATHS
+  /usr/local/include
+  /usr/local/X11R6/include
+  /usr/local/X11/include
+  /usr/freeware/include
+  PATH_SUFFIXES freetype2 include/freetype2 include
+)
+find_path(FREETYPE_INCLUDE_DIR_freetype_freetype freetype/freetype.h
+  HINTS
+  ${FREETYPE_DIR}
+  PATHS
+  /usr/local/include
+  /usr/local/X11R6/include
+  /usr/local/X11/include
+  /usr/freeware/include
+  PATH_SUFFIXES freetype2 include/freetype2 include
+)
+find_library(FREETYPE_LIBRARY
+  NAMES freetype libfreetype freetype2 freetype219
+  HINTS
+  ${FREETYPE_DIR}
+  PATH_SUFFIXES lib64 lib
+  PATHS
+  /usr/local
+  /usr/local/X11R6
+  /usr/local/X11
+  /usr/freeware
+)
+if (FREETYPE_INCLUDE_DIR_ft2build
+    AND FREETYPE_INCLUDE_DIR_freetype
+    AND (FREETYPE_INCLUDE_DIR_ft2build STREQUAL FREETYPE_INCLUDE_DIR_freetype)
+    AND FREETYPE_LIBRARY)
+  set(FREETYPE_INCLUDE_DIRS "${FREETYPE_INCLUDE_DIR_ft2build}")
+  set(HAVE_FREETYPE_H TRUE)
+  message(STATUS "Found FreeType (new-style includes): ${FREETYPE_LIBRARY}")
+elseif (FREETYPE_INCLUDE_DIR_ft2build
+        AND FREETYPE_INCLUDE_DIR_freetype_freetype
+        AND FREETYPE_LIBRARY)
+  set(FREETYPE_INCLUDE_DIRS
+      "${FREETYPE_INCLUDE_DIR_ft2build};${FREETYPE_INCLUDE_DIR_freetype_freetype}")
+  set(HAVE_FREETYPE_H TRUE)
+  message(STATUS "Found FreeType (old-style includes): ${FREETYPE_LIBRARY}")
+else ()
+  message(STATUS "FreeType not found")
+endif ()
+if (HAVE_FREETYPE_H)
+  set(HAVE_SPLASH TRUE)
+endif ()
+
+#--- look for D-Type
+if (DTYPE_INCLUDE_DIR AND DTYPE_LIBRARY)
+  set(HAVE_DTYPE4_H TRUE)
+  message(STATUS "Found D-Type: ${DTYPE_LIBRARY}")
+endif ()
+
+#--- look for zlib
+find_package(ZLIB)
+
+#--- look for libpng
+find_package(PNG)
+
+#--- look for libjpeg
+find_package(JPEG)
+
+#--- look for libtiff
+find_package(TIFF)
+
+#--- look for lcms2
+if (USE_LCMS)
+  find_path(LCMS_INCLUDE_DIR lcms2.h
+    HINTS
+    ${LCMS_DIR}
+    PATHS
+    /usr/local/include
+    /usr/freeware/include
+    PATH_SUFFIXES include
+  )
+  find_library(LCMS_LIBRARY
+    NAMES lcms2 liblcms2
+    HINTS
+    ${LCMS_DIR}
+    PATHS
+    /usr/local
+    /usr/freeware
+  )
+endif ()
+if (USE_LCMS AND LCMS_INCLUDE_DIR AND LCMS_LIBRARY)
+  set(HAVE_LCMS TRUE)
+  message(STATUS "Found lcms2: ${LCMS_LIBRARY}")
+else ()
+  set(HAVE_LCMS FALSE)
+  message(STATUS "lcms2 not found")
+endif ()
+
+#--- look for Qt
+find_package(Qt5Widgets QUIET)
+if (Qt5Widgets_FOUND)
+  find_package(Qt5PrintSupport)
+else ()
+  find_package(Qt4)
+endif ()
+if(Qt5Widgets_FOUND)
+  message(STATUS "Qt5 found")
+  if (XPDFWIDGET_PRINTING)
+    set(QT_INCLUDES "${Qt5Widgets_INCLUDE_DIRS} ${Qt5PrintSupport_INCLUDE_DIRS}")
+    set(QT_DEFINITIONS "${Qt5Widgets_DEFINITIONS} ${Qt5PrintSupport_DEFINITIONS}")
+    if (APPLE)
+      set(QT_LIBRARIES Qt5::Widgets Qt5::PrintSupport "-framework ApplicationServices")
+    elseif (UNIX)
+      set(QT_LIBRARIES Qt5::Widgets Qt5::PrintSupport cups)
+    else ()
+      set(QT_LIBRARIES Qt5::Widgets Qt5::PrintSupport)
+    endif ()
+  else ()
+    set(QT_INCLUDES "${Qt5Widgets_INCLUDE_DIRS}")
+    set(QT_DEFINITIONS "${Qt5Widgets_DEFINITIONS}")
+    set(QT_LIBRARIES Qt5::Widgets)
+  endif ()
+  if (XPDFWIDGET_PRINTING)
+    if (APPLE)
+      set(EXTRA_QT_LIBRARIES "-framework ApplicationServices")
+    elseif (UNIX)
+      set(EXTRA_QT_LIBRARIES cups)
+    else ()
+      set(EXTRA_QT_LIBRARIES "")
+    endif ()
+  endif ()
+  # remove "-fPIE" here because we added "-fPIC" above
+  string(REPLACE "-fPIE" "" QT_CFLAGS "${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}")
+  if (POLICY CMP0020)
+    # do not link to qtmain.lib
+    cmake_policy(SET CMP0020 OLD)
+  endif ()
+elseif(QT4_FOUND)
+  message(STATUS "Qt4 found")
+  if (XPDFWIDGET_PRINTING)
+    if (APPLE)
+      set(EXTRA_QT_LIBRARIES "-framework ApplicationServices")
+    elseif (UNIX)
+      set(EXTRA_QT_LIBRARIES cups)
+    else ()
+      set(EXTRA_QT_LIBRARIES "")
+    endif ()
+  endif ()
+else()
+  message(STATUS "No Qt library found")
+endif()
+
+#--- look for libpaper
+find_library(HAVE_PAPER_H
+             NAMES paper libpaper
+             PATH_SUFFIXES lib64 lib
+)
+
+#--- look for pthreads
+find_package(Threads)
+
+#--- create aconf.h
+configure_file("aconf.h.in" "aconf.h")


Property changes on: branches/stable/source/src/libs/xpdf/xpdf-src/cmake-config.txt
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Deleted: branches/stable/source/src/libs/xpdf/xpdf-src/configure
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/configure	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/configure	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,9386 +0,0 @@
-#! /bin/sh
-# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69.
-#
-#
-# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
-#
-#
-# This configure script is free software; the Free Software Foundation
-# gives unlimited permission to copy, distribute and modify it.
-## -------------------- ##
-## M4sh Initialization. ##
-## -------------------- ##
-
-# Be more Bourne compatible
-DUALCASE=1; export DUALCASE # for MKS sh
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
-  emulate sh
-  NULLCMD=:
-  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
-  # is contrary to our usage.  Disable this feature.
-  alias -g '${1+"$@"}'='"$@"'
-  setopt NO_GLOB_SUBST
-else
-  case `(set -o) 2>/dev/null` in #(
-  *posix*) :
-    set -o posix ;; #(
-  *) :
-     ;;
-esac
-fi
-
-
-as_nl='
-'
-export as_nl
-# Printing a long string crashes Solaris 7 /usr/bin/printf.
-as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
-# Prefer a ksh shell builtin over an external printf program on Solaris,
-# but without wasting forks for bash or zsh.
-if test -z "$BASH_VERSION$ZSH_VERSION" \
-    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
-  as_echo='print -r --'
-  as_echo_n='print -rn --'
-elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
-  as_echo='printf %s\n'
-  as_echo_n='printf %s'
-else
-  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
-    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
-    as_echo_n='/usr/ucb/echo -n'
-  else
-    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
-    as_echo_n_body='eval
-      arg=$1;
-      case $arg in #(
-      *"$as_nl"*)
-	expr "X$arg" : "X\\(.*\\)$as_nl";
-	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
-      esac;
-      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
-    '
-    export as_echo_n_body
-    as_echo_n='sh -c $as_echo_n_body as_echo'
-  fi
-  export as_echo_body
-  as_echo='sh -c $as_echo_body as_echo'
-fi
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
-  PATH_SEPARATOR=:
-  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
-    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
-      PATH_SEPARATOR=';'
-  }
-fi
-
-
-# IFS
-# We need space, tab and new line, in precisely that order.  Quoting is
-# there to prevent editors from complaining about space-tab.
-# (If _AS_PATH_WALK were called with IFS unset, it would disable word
-# splitting by setting IFS to empty value.)
-IFS=" ""	$as_nl"
-
-# Find who we are.  Look in the path if we contain no directory separator.
-as_myself=
-case $0 in #((
-  *[\\/]* ) as_myself=$0 ;;
-  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-  done
-IFS=$as_save_IFS
-
-     ;;
-esac
-# We did not find ourselves, most probably we were run as `sh COMMAND'
-# in which case we are not to be found in the path.
-if test "x$as_myself" = x; then
-  as_myself=$0
-fi
-if test ! -f "$as_myself"; then
-  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
-  exit 1
-fi
-
-# Unset variables that we do not need and which cause bugs (e.g. in
-# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
-# suppresses any "Segmentation fault" message there.  '((' could
-# trigger a bug in pdksh 5.2.14.
-for as_var in BASH_ENV ENV MAIL MAILPATH
-do eval test x\${$as_var+set} = xset \
-  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
-done
-PS1='$ '
-PS2='> '
-PS4='+ '
-
-# NLS nuisances.
-LC_ALL=C
-export LC_ALL
-LANGUAGE=C
-export LANGUAGE
-
-# CDPATH.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-# Use a proper internal environment variable to ensure we don't fall
-  # into an infinite loop, continuously re-executing ourselves.
-  if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
-    _as_can_reexec=no; export _as_can_reexec;
-    # We cannot yet assume a decent shell, so we have to provide a
-# neutralization value for shells without unset; and this also
-# works around shells that cannot unset nonexistent variables.
-# Preserve -v and -x to the replacement shell.
-BASH_ENV=/dev/null
-ENV=/dev/null
-(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
-case $- in # ((((
-  *v*x* | *x*v* ) as_opts=-vx ;;
-  *v* ) as_opts=-v ;;
-  *x* ) as_opts=-x ;;
-  * ) as_opts= ;;
-esac
-exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
-# Admittedly, this is quite paranoid, since all the known shells bail
-# out after a failed `exec'.
-$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
-as_fn_exit 255
-  fi
-  # We don't want this to propagate to other subprocesses.
-          { _as_can_reexec=; unset _as_can_reexec;}
-if test "x$CONFIG_SHELL" = x; then
-  as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
-  emulate sh
-  NULLCMD=:
-  # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
-  # is contrary to our usage.  Disable this feature.
-  alias -g '\${1+\"\$@\"}'='\"\$@\"'
-  setopt NO_GLOB_SUBST
-else
-  case \`(set -o) 2>/dev/null\` in #(
-  *posix*) :
-    set -o posix ;; #(
-  *) :
-     ;;
-esac
-fi
-"
-  as_required="as_fn_return () { (exit \$1); }
-as_fn_success () { as_fn_return 0; }
-as_fn_failure () { as_fn_return 1; }
-as_fn_ret_success () { return 0; }
-as_fn_ret_failure () { return 1; }
-
-exitcode=0
-as_fn_success || { exitcode=1; echo as_fn_success failed.; }
-as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
-as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
-as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
-if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
-
-else
-  exitcode=1; echo positional parameters were not saved.
-fi
-test x\$exitcode = x0 || exit 1
-test -x / || exit 1"
-  as_suggested="  as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
-  as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
-  eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
-  test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
-test \$(( 1 + 1 )) = 2 || exit 1"
-  if (eval "$as_required") 2>/dev/null; then :
-  as_have_required=yes
-else
-  as_have_required=no
-fi
-  if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
-
-else
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-as_found=false
-for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  as_found=:
-  case $as_dir in #(
-	 /*)
-	   for as_base in sh bash ksh sh5; do
-	     # Try only shells that exist, to save several forks.
-	     as_shell=$as_dir/$as_base
-	     if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
-		    { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
-  CONFIG_SHELL=$as_shell as_have_required=yes
-		   if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
-  break 2
-fi
-fi
-	   done;;
-       esac
-  as_found=false
-done
-$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
-	      { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
-  CONFIG_SHELL=$SHELL as_have_required=yes
-fi; }
-IFS=$as_save_IFS
-
-
-      if test "x$CONFIG_SHELL" != x; then :
-  export CONFIG_SHELL
-             # We cannot yet assume a decent shell, so we have to provide a
-# neutralization value for shells without unset; and this also
-# works around shells that cannot unset nonexistent variables.
-# Preserve -v and -x to the replacement shell.
-BASH_ENV=/dev/null
-ENV=/dev/null
-(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
-case $- in # ((((
-  *v*x* | *x*v* ) as_opts=-vx ;;
-  *v* ) as_opts=-v ;;
-  *x* ) as_opts=-x ;;
-  * ) as_opts= ;;
-esac
-exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
-# Admittedly, this is quite paranoid, since all the known shells bail
-# out after a failed `exec'.
-$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
-exit 255
-fi
-
-    if test x$as_have_required = xno; then :
-  $as_echo "$0: This script requires a shell more modern than all"
-  $as_echo "$0: the shells that I found on your system."
-  if test x${ZSH_VERSION+set} = xset ; then
-    $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
-    $as_echo "$0: be upgraded to zsh 4.3.4 or later."
-  else
-    $as_echo "$0: Please tell bug-autoconf at gnu.org about your system,
-$0: including any error possibly output before this
-$0: message. Then install a modern shell, or manually run
-$0: the script under such a shell if you do have one."
-  fi
-  exit 1
-fi
-fi
-fi
-SHELL=${CONFIG_SHELL-/bin/sh}
-export SHELL
-# Unset more variables known to interfere with behavior of common tools.
-CLICOLOR_FORCE= GREP_OPTIONS=
-unset CLICOLOR_FORCE GREP_OPTIONS
-
-## --------------------- ##
-## M4sh Shell Functions. ##
-## --------------------- ##
-# as_fn_unset VAR
-# ---------------
-# Portably unset VAR.
-as_fn_unset ()
-{
-  { eval $1=; unset $1;}
-}
-as_unset=as_fn_unset
-
-# as_fn_set_status STATUS
-# -----------------------
-# Set $? to STATUS, without forking.
-as_fn_set_status ()
-{
-  return $1
-} # as_fn_set_status
-
-# as_fn_exit STATUS
-# -----------------
-# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
-as_fn_exit ()
-{
-  set +e
-  as_fn_set_status $1
-  exit $1
-} # as_fn_exit
-
-# as_fn_mkdir_p
-# -------------
-# Create "$as_dir" as a directory, including parents if necessary.
-as_fn_mkdir_p ()
-{
-
-  case $as_dir in #(
-  -*) as_dir=./$as_dir;;
-  esac
-  test -d "$as_dir" || eval $as_mkdir_p || {
-    as_dirs=
-    while :; do
-      case $as_dir in #(
-      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
-      *) as_qdir=$as_dir;;
-      esac
-      as_dirs="'$as_qdir' $as_dirs"
-      as_dir=`$as_dirname -- "$as_dir" ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	 X"$as_dir" : 'X\(//\)[^/]' \| \
-	 X"$as_dir" : 'X\(//\)$' \| \
-	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$as_dir" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\/\)[^/].*/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\/\)$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\).*/{
-	    s//\1/
-	    q
-	  }
-	  s/.*/./; q'`
-      test -d "$as_dir" && break
-    done
-    test -z "$as_dirs" || eval "mkdir $as_dirs"
-  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
-
-
-} # as_fn_mkdir_p
-
-# as_fn_executable_p FILE
-# -----------------------
-# Test if FILE is an executable regular file.
-as_fn_executable_p ()
-{
-  test -f "$1" && test -x "$1"
-} # as_fn_executable_p
-# as_fn_append VAR VALUE
-# ----------------------
-# Append the text in VALUE to the end of the definition contained in VAR. Take
-# advantage of any shell optimizations that allow amortized linear growth over
-# repeated appends, instead of the typical quadratic growth present in naive
-# implementations.
-if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
-  eval 'as_fn_append ()
-  {
-    eval $1+=\$2
-  }'
-else
-  as_fn_append ()
-  {
-    eval $1=\$$1\$2
-  }
-fi # as_fn_append
-
-# as_fn_arith ARG...
-# ------------------
-# Perform arithmetic evaluation on the ARGs, and store the result in the
-# global $as_val. Take advantage of shells that can avoid forks. The arguments
-# must be portable across $(()) and expr.
-if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
-  eval 'as_fn_arith ()
-  {
-    as_val=$(( $* ))
-  }'
-else
-  as_fn_arith ()
-  {
-    as_val=`expr "$@" || test $? -eq 1`
-  }
-fi # as_fn_arith
-
-
-# as_fn_error STATUS ERROR [LINENO LOG_FD]
-# ----------------------------------------
-# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
-# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
-# script with STATUS, using 1 if that was 0.
-as_fn_error ()
-{
-  as_status=$1; test $as_status -eq 0 && as_status=1
-  if test "$4"; then
-    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
-  fi
-  $as_echo "$as_me: error: $2" >&2
-  as_fn_exit $as_status
-} # as_fn_error
-
-if expr a : '\(a\)' >/dev/null 2>&1 &&
-   test "X`expr 00001 : '.*\(...\)'`" = X001; then
-  as_expr=expr
-else
-  as_expr=false
-fi
-
-if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
-  as_basename=basename
-else
-  as_basename=false
-fi
-
-if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
-  as_dirname=dirname
-else
-  as_dirname=false
-fi
-
-as_me=`$as_basename -- "$0" ||
-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
-	 X"$0" : 'X\(//\)$' \| \
-	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X/"$0" |
-    sed '/^.*\/\([^/][^/]*\)\/*$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\/\(\/\/\)$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\/\(\/\).*/{
-	    s//\1/
-	    q
-	  }
-	  s/.*/./; q'`
-
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
-
-  as_lineno_1=$LINENO as_lineno_1a=$LINENO
-  as_lineno_2=$LINENO as_lineno_2a=$LINENO
-  eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
-  test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
-  # Blame Lee E. McMahon (1931-1989) for sed's syntax.  :-)
-  sed -n '
-    p
-    /[$]LINENO/=
-  ' <$as_myself |
-    sed '
-      s/[$]LINENO.*/&-/
-      t lineno
-      b
-      :lineno
-      N
-      :loop
-      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
-      t loop
-      s/-\n.*//
-    ' >$as_me.lineno &&
-  chmod +x "$as_me.lineno" ||
-    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
-
-  # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
-  # already done that, so ensure we don't try to do so again and fall
-  # in an infinite loop.  This has already happened in practice.
-  _as_can_reexec=no; export _as_can_reexec
-  # Don't try to exec as it changes $[0], causing all sort of problems
-  # (the dirname of $[0] is not the place where we might find the
-  # original and so on.  Autoconf is especially sensitive to this).
-  . "./$as_me.lineno"
-  # Exit status is that of the last command.
-  exit
-}
-
-ECHO_C= ECHO_N= ECHO_T=
-case `echo -n x` in #(((((
--n*)
-  case `echo 'xy\c'` in
-  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
-  xy)  ECHO_C='\c';;
-  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
-       ECHO_T='	';;
-  esac;;
-*)
-  ECHO_N='-n';;
-esac
-
-rm -f conf$$ conf$$.exe conf$$.file
-if test -d conf$$.dir; then
-  rm -f conf$$.dir/conf$$.file
-else
-  rm -f conf$$.dir
-  mkdir conf$$.dir 2>/dev/null
-fi
-if (echo >conf$$.file) 2>/dev/null; then
-  if ln -s conf$$.file conf$$ 2>/dev/null; then
-    as_ln_s='ln -s'
-    # ... but there are two gotchas:
-    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
-    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
-    # In both cases, we have to default to `cp -pR'.
-    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
-      as_ln_s='cp -pR'
-  elif ln conf$$.file conf$$ 2>/dev/null; then
-    as_ln_s=ln
-  else
-    as_ln_s='cp -pR'
-  fi
-else
-  as_ln_s='cp -pR'
-fi
-rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
-rmdir conf$$.dir 2>/dev/null
-
-if mkdir -p . 2>/dev/null; then
-  as_mkdir_p='mkdir -p "$as_dir"'
-else
-  test -d ./-p && rmdir ./-p
-  as_mkdir_p=false
-fi
-
-as_test_x='test -x'
-as_executable_p=as_fn_executable_p
-
-# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
-
-# Sed expression to map a string onto a valid variable name.
-as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
-
-
-test -n "$DJDIR" || exec 7<&0 </dev/null
-exec 6>&1
-
-# Name of the host.
-# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
-# so uname gets run too.
-ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
-
-#
-# Initializations.
-#
-ac_default_prefix=/usr/local
-ac_clean_files=
-ac_config_libobj_dir=.
-LIBOBJS=
-cross_compiling=no
-subdirs=
-MFLAGS=
-MAKEFLAGS=
-
-# Identity of this package.
-PACKAGE_NAME=
-PACKAGE_TARNAME=
-PACKAGE_VERSION=
-PACKAGE_STRING=
-PACKAGE_BUGREPORT=
-PACKAGE_URL=
-
-ac_unique_file="xpdf/Gfx.cc"
-# Factoring default headers for most tests.
-ac_includes_default="\
-#include <stdio.h>
-#ifdef HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-#ifdef HAVE_SYS_STAT_H
-# include <sys/stat.h>
-#endif
-#ifdef STDC_HEADERS
-# include <stdlib.h>
-# include <stddef.h>
-#else
-# ifdef HAVE_STDLIB_H
-#  include <stdlib.h>
-# endif
-#endif
-#ifdef HAVE_STRING_H
-# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
-#  include <memory.h>
-# endif
-# include <string.h>
-#endif
-#ifdef HAVE_STRINGS_H
-# include <strings.h>
-#endif
-#ifdef HAVE_INTTYPES_H
-# include <inttypes.h>
-#endif
-#ifdef HAVE_STDINT_H
-# include <stdint.h>
-#endif
-#ifdef HAVE_UNISTD_H
-# include <unistd.h>
-#endif"
-
-ac_subst_vars='LTLIBOBJS
-LIBOBJS
-EXTRA_CFLAGS
-EXTRA_LIBS
-XPDF_TARGET
-X
-libpaper_CFLAGS
-libpaper_LIBS
-libpng_CFLAGS
-libpng_LIBS
-freetype2_CFLAGS
-freetype2_LIBS
-Sgm_CFLAGS
-Sgm_LIBS
-Xm_CFLAGS
-Xm_LIBS
-Xt_CFLAGS
-Xt_LIBS
-Xp_CFLAGS
-Xp_LIBS
-Xext_CFLAGS
-Xext_LIBS
-Xpm_CFLAGS
-Xpm_LIBS
-EGREP
-GREP
-X_EXTRA_LIBS
-X_LIBS
-X_PRE_LIBS
-X_CFLAGS
-CPP
-XMKMF
-UP_DIR
-AR
-LIBPREFIX
-EXE
-RANLIB
-INSTALL_DATA
-INSTALL_SCRIPT
-INSTALL_PROGRAM
-ac_ct_CXX
-CXXFLAGS
-CXX
-OBJEXT
-EXEEXT
-ac_ct_CC
-CPPFLAGS
-LDFLAGS
-CFLAGS
-CC
-target_alias
-host_alias
-build_alias
-LIBS
-ECHO_T
-ECHO_N
-ECHO_C
-DEFS
-mandir
-localedir
-libdir
-psdir
-pdfdir
-dvidir
-htmldir
-infodir
-docdir
-oldincludedir
-includedir
-localstatedir
-sharedstatedir
-sysconfdir
-datadir
-datarootdir
-libexecdir
-sbindir
-bindir
-program_transform_name
-prefix
-exec_prefix
-PACKAGE_URL
-PACKAGE_BUGREPORT
-PACKAGE_STRING
-PACKAGE_VERSION
-PACKAGE_TARNAME
-PACKAGE_NAME
-PATH_SEPARATOR
-SHELL'
-ac_subst_files=''
-ac_user_opts='
-enable_option_checking
-enable_a4_paper
-enable_no_text_select
-enable_opi
-enable_multithreaded
-enable_exceptions
-enable_fixedpoint
-enable_cmyk
-with_appdef_dir
-with_x
-enable_largefile
-with_Xpm_library
-with_Xpm_includes
-with_Xext_library
-with_Xext_includes
-with_Xp_library
-with_Xp_includes
-with_Xt_library
-with_Xt_includes
-with_Xm_library
-with_Xm_includes
-with_Sgm_library
-with_Sgm_includes
-with_freetype2_library
-with_freetype2_includes
-with_libpng_library
-with_libpng_includes
-with_libpaper_library
-with_libpaper_includes
-'
-      ac_precious_vars='build_alias
-host_alias
-target_alias
-CC
-CFLAGS
-LDFLAGS
-LIBS
-CPPFLAGS
-CXX
-CXXFLAGS
-CCC
-XMKMF
-CPP'
-
-
-# Initialize some variables set by options.
-ac_init_help=
-ac_init_version=false
-ac_unrecognized_opts=
-ac_unrecognized_sep=
-# The variables have the same names as the options, with
-# dashes changed to underlines.
-cache_file=/dev/null
-exec_prefix=NONE
-no_create=
-no_recursion=
-prefix=NONE
-program_prefix=NONE
-program_suffix=NONE
-program_transform_name=s,x,x,
-silent=
-site=
-srcdir=
-verbose=
-x_includes=NONE
-x_libraries=NONE
-
-# Installation directory options.
-# These are left unexpanded so users can "make install exec_prefix=/foo"
-# and all the variables that are supposed to be based on exec_prefix
-# by default will actually change.
-# Use braces instead of parens because sh, perl, etc. also accept them.
-# (The list follows the same order as the GNU Coding Standards.)
-bindir='${exec_prefix}/bin'
-sbindir='${exec_prefix}/sbin'
-libexecdir='${exec_prefix}/libexec'
-datarootdir='${prefix}/share'
-datadir='${datarootdir}'
-sysconfdir='${prefix}/etc'
-sharedstatedir='${prefix}/com'
-localstatedir='${prefix}/var'
-includedir='${prefix}/include'
-oldincludedir='/usr/include'
-docdir='${datarootdir}/doc/${PACKAGE}'
-infodir='${datarootdir}/info'
-htmldir='${docdir}'
-dvidir='${docdir}'
-pdfdir='${docdir}'
-psdir='${docdir}'
-libdir='${exec_prefix}/lib'
-localedir='${datarootdir}/locale'
-mandir='${datarootdir}/man'
-
-ac_prev=
-ac_dashdash=
-for ac_option
-do
-  # If the previous option needs an argument, assign it.
-  if test -n "$ac_prev"; then
-    eval $ac_prev=\$ac_option
-    ac_prev=
-    continue
-  fi
-
-  case $ac_option in
-  *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
-  *=)   ac_optarg= ;;
-  *)    ac_optarg=yes ;;
-  esac
-
-  # Accept the important Cygnus configure options, so we can diagnose typos.
-
-  case $ac_dashdash$ac_option in
-  --)
-    ac_dashdash=yes ;;
-
-  -bindir | --bindir | --bindi | --bind | --bin | --bi)
-    ac_prev=bindir ;;
-  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
-    bindir=$ac_optarg ;;
-
-  -build | --build | --buil | --bui | --bu)
-    ac_prev=build_alias ;;
-  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
-    build_alias=$ac_optarg ;;
-
-  -cache-file | --cache-file | --cache-fil | --cache-fi \
-  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
-    ac_prev=cache_file ;;
-  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
-  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
-    cache_file=$ac_optarg ;;
-
-  --config-cache | -C)
-    cache_file=config.cache ;;
-
-  -datadir | --datadir | --datadi | --datad)
-    ac_prev=datadir ;;
-  -datadir=* | --datadir=* | --datadi=* | --datad=*)
-    datadir=$ac_optarg ;;
-
-  -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
-  | --dataroo | --dataro | --datar)
-    ac_prev=datarootdir ;;
-  -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
-  | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
-    datarootdir=$ac_optarg ;;
-
-  -disable-* | --disable-*)
-    ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
-    # Reject names that are not valid shell variable names.
-    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
-      as_fn_error $? "invalid feature name: $ac_useropt"
-    ac_useropt_orig=$ac_useropt
-    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
-    case $ac_user_opts in
-      *"
-"enable_$ac_useropt"
-"*) ;;
-      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
-	 ac_unrecognized_sep=', ';;
-    esac
-    eval enable_$ac_useropt=no ;;
-
-  -docdir | --docdir | --docdi | --doc | --do)
-    ac_prev=docdir ;;
-  -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
-    docdir=$ac_optarg ;;
-
-  -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
-    ac_prev=dvidir ;;
-  -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
-    dvidir=$ac_optarg ;;
-
-  -enable-* | --enable-*)
-    ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
-    # Reject names that are not valid shell variable names.
-    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
-      as_fn_error $? "invalid feature name: $ac_useropt"
-    ac_useropt_orig=$ac_useropt
-    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
-    case $ac_user_opts in
-      *"
-"enable_$ac_useropt"
-"*) ;;
-      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
-	 ac_unrecognized_sep=', ';;
-    esac
-    eval enable_$ac_useropt=\$ac_optarg ;;
-
-  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
-  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
-  | --exec | --exe | --ex)
-    ac_prev=exec_prefix ;;
-  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
-  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
-  | --exec=* | --exe=* | --ex=*)
-    exec_prefix=$ac_optarg ;;
-
-  -gas | --gas | --ga | --g)
-    # Obsolete; use --with-gas.
-    with_gas=yes ;;
-
-  -help | --help | --hel | --he | -h)
-    ac_init_help=long ;;
-  -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
-    ac_init_help=recursive ;;
-  -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
-    ac_init_help=short ;;
-
-  -host | --host | --hos | --ho)
-    ac_prev=host_alias ;;
-  -host=* | --host=* | --hos=* | --ho=*)
-    host_alias=$ac_optarg ;;
-
-  -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
-    ac_prev=htmldir ;;
-  -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
-  | --ht=*)
-    htmldir=$ac_optarg ;;
-
-  -includedir | --includedir | --includedi | --included | --include \
-  | --includ | --inclu | --incl | --inc)
-    ac_prev=includedir ;;
-  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
-  | --includ=* | --inclu=* | --incl=* | --inc=*)
-    includedir=$ac_optarg ;;
-
-  -infodir | --infodir | --infodi | --infod | --info | --inf)
-    ac_prev=infodir ;;
-  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
-    infodir=$ac_optarg ;;
-
-  -libdir | --libdir | --libdi | --libd)
-    ac_prev=libdir ;;
-  -libdir=* | --libdir=* | --libdi=* | --libd=*)
-    libdir=$ac_optarg ;;
-
-  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
-  | --libexe | --libex | --libe)
-    ac_prev=libexecdir ;;
-  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
-  | --libexe=* | --libex=* | --libe=*)
-    libexecdir=$ac_optarg ;;
-
-  -localedir | --localedir | --localedi | --localed | --locale)
-    ac_prev=localedir ;;
-  -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
-    localedir=$ac_optarg ;;
-
-  -localstatedir | --localstatedir | --localstatedi | --localstated \
-  | --localstate | --localstat | --localsta | --localst | --locals)
-    ac_prev=localstatedir ;;
-  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
-  | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
-    localstatedir=$ac_optarg ;;
-
-  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
-    ac_prev=mandir ;;
-  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
-    mandir=$ac_optarg ;;
-
-  -nfp | --nfp | --nf)
-    # Obsolete; use --without-fp.
-    with_fp=no ;;
-
-  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
-  | --no-cr | --no-c | -n)
-    no_create=yes ;;
-
-  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
-  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
-    no_recursion=yes ;;
-
-  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
-  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
-  | --oldin | --oldi | --old | --ol | --o)
-    ac_prev=oldincludedir ;;
-  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
-  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
-  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
-    oldincludedir=$ac_optarg ;;
-
-  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
-    ac_prev=prefix ;;
-  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
-    prefix=$ac_optarg ;;
-
-  -program-prefix | --program-prefix | --program-prefi | --program-pref \
-  | --program-pre | --program-pr | --program-p)
-    ac_prev=program_prefix ;;
-  -program-prefix=* | --program-prefix=* | --program-prefi=* \
-  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
-    program_prefix=$ac_optarg ;;
-
-  -program-suffix | --program-suffix | --program-suffi | --program-suff \
-  | --program-suf | --program-su | --program-s)
-    ac_prev=program_suffix ;;
-  -program-suffix=* | --program-suffix=* | --program-suffi=* \
-  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
-    program_suffix=$ac_optarg ;;
-
-  -program-transform-name | --program-transform-name \
-  | --program-transform-nam | --program-transform-na \
-  | --program-transform-n | --program-transform- \
-  | --program-transform | --program-transfor \
-  | --program-transfo | --program-transf \
-  | --program-trans | --program-tran \
-  | --progr-tra | --program-tr | --program-t)
-    ac_prev=program_transform_name ;;
-  -program-transform-name=* | --program-transform-name=* \
-  | --program-transform-nam=* | --program-transform-na=* \
-  | --program-transform-n=* | --program-transform-=* \
-  | --program-transform=* | --program-transfor=* \
-  | --program-transfo=* | --program-transf=* \
-  | --program-trans=* | --program-tran=* \
-  | --progr-tra=* | --program-tr=* | --program-t=*)
-    program_transform_name=$ac_optarg ;;
-
-  -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
-    ac_prev=pdfdir ;;
-  -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
-    pdfdir=$ac_optarg ;;
-
-  -psdir | --psdir | --psdi | --psd | --ps)
-    ac_prev=psdir ;;
-  -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
-    psdir=$ac_optarg ;;
-
-  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
-  | -silent | --silent | --silen | --sile | --sil)
-    silent=yes ;;
-
-  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
-    ac_prev=sbindir ;;
-  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
-  | --sbi=* | --sb=*)
-    sbindir=$ac_optarg ;;
-
-  -sharedstatedir | --sharedstatedir | --sharedstatedi \
-  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
-  | --sharedst | --shareds | --shared | --share | --shar \
-  | --sha | --sh)
-    ac_prev=sharedstatedir ;;
-  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
-  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
-  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
-  | --sha=* | --sh=*)
-    sharedstatedir=$ac_optarg ;;
-
-  -site | --site | --sit)
-    ac_prev=site ;;
-  -site=* | --site=* | --sit=*)
-    site=$ac_optarg ;;
-
-  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
-    ac_prev=srcdir ;;
-  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
-    srcdir=$ac_optarg ;;
-
-  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
-  | --syscon | --sysco | --sysc | --sys | --sy)
-    ac_prev=sysconfdir ;;
-  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
-  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
-    sysconfdir=$ac_optarg ;;
-
-  -target | --target | --targe | --targ | --tar | --ta | --t)
-    ac_prev=target_alias ;;
-  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
-    target_alias=$ac_optarg ;;
-
-  -v | -verbose | --verbose | --verbos | --verbo | --verb)
-    verbose=yes ;;
-
-  -version | --version | --versio | --versi | --vers | -V)
-    ac_init_version=: ;;
-
-  -with-* | --with-*)
-    ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
-    # Reject names that are not valid shell variable names.
-    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
-      as_fn_error $? "invalid package name: $ac_useropt"
-    ac_useropt_orig=$ac_useropt
-    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
-    case $ac_user_opts in
-      *"
-"with_$ac_useropt"
-"*) ;;
-      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
-	 ac_unrecognized_sep=', ';;
-    esac
-    eval with_$ac_useropt=\$ac_optarg ;;
-
-  -without-* | --without-*)
-    ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
-    # Reject names that are not valid shell variable names.
-    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
-      as_fn_error $? "invalid package name: $ac_useropt"
-    ac_useropt_orig=$ac_useropt
-    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
-    case $ac_user_opts in
-      *"
-"with_$ac_useropt"
-"*) ;;
-      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
-	 ac_unrecognized_sep=', ';;
-    esac
-    eval with_$ac_useropt=no ;;
-
-  --x)
-    # Obsolete; use --with-x.
-    with_x=yes ;;
-
-  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
-  | --x-incl | --x-inc | --x-in | --x-i)
-    ac_prev=x_includes ;;
-  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
-  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
-    x_includes=$ac_optarg ;;
-
-  -x-libraries | --x-libraries | --x-librarie | --x-librari \
-  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
-    ac_prev=x_libraries ;;
-  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
-  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
-    x_libraries=$ac_optarg ;;
-
-  -*) as_fn_error $? "unrecognized option: \`$ac_option'
-Try \`$0 --help' for more information"
-    ;;
-
-  *=*)
-    ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
-    # Reject names that are not valid shell variable names.
-    case $ac_envvar in #(
-      '' | [0-9]* | *[!_$as_cr_alnum]* )
-      as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
-    esac
-    eval $ac_envvar=\$ac_optarg
-    export $ac_envvar ;;
-
-  *)
-    # FIXME: should be removed in autoconf 3.0.
-    $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
-    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
-      $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
-    : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
-    ;;
-
-  esac
-done
-
-if test -n "$ac_prev"; then
-  ac_option=--`echo $ac_prev | sed 's/_/-/g'`
-  as_fn_error $? "missing argument to $ac_option"
-fi
-
-if test -n "$ac_unrecognized_opts"; then
-  case $enable_option_checking in
-    no) ;;
-    fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
-    *)     $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
-  esac
-fi
-
-# Check all directory arguments for consistency.
-for ac_var in	exec_prefix prefix bindir sbindir libexecdir datarootdir \
-		datadir sysconfdir sharedstatedir localstatedir includedir \
-		oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
-		libdir localedir mandir
-do
-  eval ac_val=\$$ac_var
-  # Remove trailing slashes.
-  case $ac_val in
-    */ )
-      ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
-      eval $ac_var=\$ac_val;;
-  esac
-  # Be sure to have absolute directory names.
-  case $ac_val in
-    [\\/$]* | ?:[\\/]* )  continue;;
-    NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
-  esac
-  as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
-done
-
-# There might be people who depend on the old broken behavior: `$host'
-# used to hold the argument of --host etc.
-# FIXME: To remove some day.
-build=$build_alias
-host=$host_alias
-target=$target_alias
-
-# FIXME: To remove some day.
-if test "x$host_alias" != x; then
-  if test "x$build_alias" = x; then
-    cross_compiling=maybe
-  elif test "x$build_alias" != "x$host_alias"; then
-    cross_compiling=yes
-  fi
-fi
-
-ac_tool_prefix=
-test -n "$host_alias" && ac_tool_prefix=$host_alias-
-
-test "$silent" = yes && exec 6>/dev/null
-
-
-ac_pwd=`pwd` && test -n "$ac_pwd" &&
-ac_ls_di=`ls -di .` &&
-ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
-  as_fn_error $? "working directory cannot be determined"
-test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
-  as_fn_error $? "pwd does not report name of working directory"
-
-
-# Find the source files, if location was not specified.
-if test -z "$srcdir"; then
-  ac_srcdir_defaulted=yes
-  # Try the directory containing this script, then the parent directory.
-  ac_confdir=`$as_dirname -- "$as_myself" ||
-$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	 X"$as_myself" : 'X\(//\)[^/]' \| \
-	 X"$as_myself" : 'X\(//\)$' \| \
-	 X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$as_myself" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\/\)[^/].*/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\/\)$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\).*/{
-	    s//\1/
-	    q
-	  }
-	  s/.*/./; q'`
-  srcdir=$ac_confdir
-  if test ! -r "$srcdir/$ac_unique_file"; then
-    srcdir=..
-  fi
-else
-  ac_srcdir_defaulted=no
-fi
-if test ! -r "$srcdir/$ac_unique_file"; then
-  test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
-  as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
-fi
-ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
-ac_abs_confdir=`(
-	cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
-	pwd)`
-# When building in place, set srcdir=.
-if test "$ac_abs_confdir" = "$ac_pwd"; then
-  srcdir=.
-fi
-# Remove unnecessary trailing slashes from srcdir.
-# Double slashes in file names in object file debugging info
-# mess up M-x gdb in Emacs.
-case $srcdir in
-*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
-esac
-for ac_var in $ac_precious_vars; do
-  eval ac_env_${ac_var}_set=\${${ac_var}+set}
-  eval ac_env_${ac_var}_value=\$${ac_var}
-  eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
-  eval ac_cv_env_${ac_var}_value=\$${ac_var}
-done
-
-#
-# Report the --help message.
-#
-if test "$ac_init_help" = "long"; then
-  # Omit some internal or obsolete options to make the list less imposing.
-  # This message is too long to be a string in the A/UX 3.1 sh.
-  cat <<_ACEOF
-\`configure' configures this package to adapt to many kinds of systems.
-
-Usage: $0 [OPTION]... [VAR=VALUE]...
-
-To assign environment variables (e.g., CC, CFLAGS...), specify them as
-VAR=VALUE.  See below for descriptions of some of the useful variables.
-
-Defaults for the options are specified in brackets.
-
-Configuration:
-  -h, --help              display this help and exit
-      --help=short        display options specific to this package
-      --help=recursive    display the short help of all the included packages
-  -V, --version           display version information and exit
-  -q, --quiet, --silent   do not print \`checking ...' messages
-      --cache-file=FILE   cache test results in FILE [disabled]
-  -C, --config-cache      alias for \`--cache-file=config.cache'
-  -n, --no-create         do not create output files
-      --srcdir=DIR        find the sources in DIR [configure dir or \`..']
-
-Installation directories:
-  --prefix=PREFIX         install architecture-independent files in PREFIX
-                          [$ac_default_prefix]
-  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
-                          [PREFIX]
-
-By default, \`make install' will install all the files in
-\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
-an installation prefix other than \`$ac_default_prefix' using \`--prefix',
-for instance \`--prefix=\$HOME'.
-
-For better control, use the options below.
-
-Fine tuning of the installation directories:
-  --bindir=DIR            user executables [EPREFIX/bin]
-  --sbindir=DIR           system admin executables [EPREFIX/sbin]
-  --libexecdir=DIR        program executables [EPREFIX/libexec]
-  --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
-  --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
-  --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
-  --libdir=DIR            object code libraries [EPREFIX/lib]
-  --includedir=DIR        C header files [PREFIX/include]
-  --oldincludedir=DIR     C header files for non-gcc [/usr/include]
-  --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
-  --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
-  --infodir=DIR           info documentation [DATAROOTDIR/info]
-  --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
-  --mandir=DIR            man documentation [DATAROOTDIR/man]
-  --docdir=DIR            documentation root [DATAROOTDIR/doc/PACKAGE]
-  --htmldir=DIR           html documentation [DOCDIR]
-  --dvidir=DIR            dvi documentation [DOCDIR]
-  --pdfdir=DIR            pdf documentation [DOCDIR]
-  --psdir=DIR             ps documentation [DOCDIR]
-_ACEOF
-
-  cat <<\_ACEOF
-
-X features:
-  --x-includes=DIR    X include files are in DIR
-  --x-libraries=DIR   X library files are in DIR
-_ACEOF
-fi
-
-if test -n "$ac_init_help"; then
-
-  cat <<\_ACEOF
-
-Optional Features:
-  --disable-option-checking  ignore unrecognized --enable/--with options
-  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
-  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
-  --enable-a4-paper       use A4 paper size instead of Letter for PostScript
-                          output
-  --enable-no-text-select do not allow text selection
-  --enable-opi            include support for OPI comments
-  --enable-multithreaded  include support for multithreading
-  --enable-exceptions     use C++ exceptions
-  --enable-fixedpoint     use fixed point (instead of floating point)
-                          arithmetic
-  --enable-cmyk           include support for CMYK rasterization
-  --disable-largefile     omit support for large files
-
-Optional Packages:
-  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
-  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
-  --with-appdef-dir       set app-defaults directory
-  --with-x                use the X Window System
-  --with-Xpm-library=PATH
-                          use Xpm library (pixmap library - used only for icon)
-  --with-Xpm-includes=DIR
-                          set directory for Xpm headers
-  --with-Xext-library=PATH
-                          use Xext library (Motif library)
-  --with-Xext-includes=DIR
-                          set directory for Xext headers
-  --with-Xp-library=PATH
-                          use Xp library (Motif library)
-  --with-Xp-includes=DIR
-                          set directory for Xp headers
-  --with-Xt-library=PATH
-                          use Xt library (Motif library)
-  --with-Xt-includes=DIR
-                          set directory for Xt headers
-  --with-Xm-library=PATH
-                          use Xm library (Motif library)
-  --with-Xm-includes=DIR
-                          set directory for Xm headers
-  --with-Sgm-library=PATH
-                          use Sgm library (SGI Motif library)
-  --with-Sgm-includes=DIR
-                          set directory for Sgm headers
-  --with-freetype2-library=PATH
-                          use freetype2 library (FreeType2 font rasterizer - version 2.0.5+)
-  --with-freetype2-includes=DIR
-                          set directory for freetype2 headers
-  --with-libpng-library=PATH
-                          use libpng library (PNG library)
-  --with-libpng-includes=DIR
-                          set directory for libpng headers
-  --with-libpaper-library=PATH
-                          use libpaper library (Debian libpaper)
-  --with-libpaper-includes=DIR
-                          set directory for libpaper headers
-
-Some influential environment variables:
-  CC          C compiler command
-  CFLAGS      C compiler flags
-  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
-              nonstandard directory <lib dir>
-  LIBS        libraries to pass to the linker, e.g. -l<library>
-  CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
-              you have headers in a nonstandard directory <include dir>
-  CXX         C++ compiler command
-  CXXFLAGS    C++ compiler flags
-  XMKMF       Path to xmkmf, Makefile generator for X Window System
-  CPP         C preprocessor
-
-Use these variables to override the choices made by `configure' or to help
-it to find libraries and programs with nonstandard names/locations.
-
-Report bugs to the package provider.
-_ACEOF
-ac_status=$?
-fi
-
-if test "$ac_init_help" = "recursive"; then
-  # If there are subdirs, report their specific --help.
-  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
-    test -d "$ac_dir" ||
-      { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
-      continue
-    ac_builddir=.
-
-case "$ac_dir" in
-.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
-*)
-  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
-  # A ".." for each directory in $ac_dir_suffix.
-  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
-  case $ac_top_builddir_sub in
-  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
-  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
-  esac ;;
-esac
-ac_abs_top_builddir=$ac_pwd
-ac_abs_builddir=$ac_pwd$ac_dir_suffix
-# for backward compatibility:
-ac_top_builddir=$ac_top_build_prefix
-
-case $srcdir in
-  .)  # We are building in place.
-    ac_srcdir=.
-    ac_top_srcdir=$ac_top_builddir_sub
-    ac_abs_top_srcdir=$ac_pwd ;;
-  [\\/]* | ?:[\\/]* )  # Absolute name.
-    ac_srcdir=$srcdir$ac_dir_suffix;
-    ac_top_srcdir=$srcdir
-    ac_abs_top_srcdir=$srcdir ;;
-  *) # Relative name.
-    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
-    ac_top_srcdir=$ac_top_build_prefix$srcdir
-    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
-esac
-ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
-
-    cd "$ac_dir" || { ac_status=$?; continue; }
-    # Check for guested configure.
-    if test -f "$ac_srcdir/configure.gnu"; then
-      echo &&
-      $SHELL "$ac_srcdir/configure.gnu" --help=recursive
-    elif test -f "$ac_srcdir/configure"; then
-      echo &&
-      $SHELL "$ac_srcdir/configure" --help=recursive
-    else
-      $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
-    fi || ac_status=$?
-    cd "$ac_pwd" || { ac_status=$?; break; }
-  done
-fi
-
-test -n "$ac_init_help" && exit $ac_status
-if $ac_init_version; then
-  cat <<\_ACEOF
-configure
-generated by GNU Autoconf 2.69
-
-Copyright (C) 2012 Free Software Foundation, Inc.
-This configure script is free software; the Free Software Foundation
-gives unlimited permission to copy, distribute and modify it.
-_ACEOF
-  exit
-fi
-
-## ------------------------ ##
-## Autoconf initialization. ##
-## ------------------------ ##
-
-# ac_fn_c_try_compile LINENO
-# --------------------------
-# Try to compile conftest.$ac_ext, and return whether this succeeded.
-ac_fn_c_try_compile ()
-{
-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  rm -f conftest.$ac_objext
-  if { { ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_compile") 2>conftest.err
-  ac_status=$?
-  if test -s conftest.err; then
-    grep -v '^ *+' conftest.err >conftest.er1
-    cat conftest.er1 >&5
-    mv -f conftest.er1 conftest.err
-  fi
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then :
-  ac_retval=0
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_retval=1
-fi
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-  as_fn_set_status $ac_retval
-
-} # ac_fn_c_try_compile
-
-# ac_fn_c_try_link LINENO
-# -----------------------
-# Try to link conftest.$ac_ext, and return whether this succeeded.
-ac_fn_c_try_link ()
-{
-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  rm -f conftest.$ac_objext conftest$ac_exeext
-  if { { ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_link") 2>conftest.err
-  ac_status=$?
-  if test -s conftest.err; then
-    grep -v '^ *+' conftest.err >conftest.er1
-    cat conftest.er1 >&5
-    mv -f conftest.er1 conftest.err
-  fi
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && {
-	 test -z "$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 test -x conftest$ac_exeext
-       }; then :
-  ac_retval=0
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_retval=1
-fi
-  # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
-  # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
-  # interfere with the next link command; also delete a directory that is
-  # left behind by Apple's compiler.  We do this before executing the actions.
-  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-  as_fn_set_status $ac_retval
-
-} # ac_fn_c_try_link
-
-# ac_fn_cxx_try_compile LINENO
-# ----------------------------
-# Try to compile conftest.$ac_ext, and return whether this succeeded.
-ac_fn_cxx_try_compile ()
-{
-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  rm -f conftest.$ac_objext
-  if { { ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_compile") 2>conftest.err
-  ac_status=$?
-  if test -s conftest.err; then
-    grep -v '^ *+' conftest.err >conftest.er1
-    cat conftest.er1 >&5
-    mv -f conftest.er1 conftest.err
-  fi
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && {
-	 test -z "$ac_cxx_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then :
-  ac_retval=0
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_retval=1
-fi
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-  as_fn_set_status $ac_retval
-
-} # ac_fn_cxx_try_compile
-
-# ac_fn_c_try_cpp LINENO
-# ----------------------
-# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
-ac_fn_c_try_cpp ()
-{
-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  if { { ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
-  ac_status=$?
-  if test -s conftest.err; then
-    grep -v '^ *+' conftest.err >conftest.er1
-    cat conftest.er1 >&5
-    mv -f conftest.er1 conftest.err
-  fi
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } > conftest.i && {
-	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-	 test ! -s conftest.err
-       }; then :
-  ac_retval=0
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-    ac_retval=1
-fi
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-  as_fn_set_status $ac_retval
-
-} # ac_fn_c_try_cpp
-
-# ac_fn_c_check_func LINENO FUNC VAR
-# ----------------------------------
-# Tests whether FUNC exists, setting the cache variable VAR accordingly
-ac_fn_c_check_func ()
-{
-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $2 innocuous_$2
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $2 (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $2
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $2 ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined __stub_$2 || defined __stub___$2
-choke me
-#endif
-
-int
-main ()
-{
-return $2 ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  eval "$3=yes"
-else
-  eval "$3=no"
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-fi
-eval ac_res=\$$3
-	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
-} # ac_fn_c_check_func
-
-# ac_fn_cxx_try_link LINENO
-# -------------------------
-# Try to link conftest.$ac_ext, and return whether this succeeded.
-ac_fn_cxx_try_link ()
-{
-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  rm -f conftest.$ac_objext conftest$ac_exeext
-  if { { ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_link") 2>conftest.err
-  ac_status=$?
-  if test -s conftest.err; then
-    grep -v '^ *+' conftest.err >conftest.er1
-    cat conftest.er1 >&5
-    mv -f conftest.er1 conftest.err
-  fi
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && {
-	 test -z "$ac_cxx_werror_flag" ||
-	 test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-	 test "$cross_compiling" = yes ||
-	 test -x conftest$ac_exeext
-       }; then :
-  ac_retval=0
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-	ac_retval=1
-fi
-  # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
-  # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
-  # interfere with the next link command; also delete a directory that is
-  # left behind by Apple's compiler.  We do this before executing the actions.
-  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-  as_fn_set_status $ac_retval
-
-} # ac_fn_cxx_try_link
-
-# ac_fn_cxx_check_func LINENO FUNC VAR
-# ------------------------------------
-# Tests whether FUNC exists, setting the cache variable VAR accordingly
-ac_fn_cxx_check_func ()
-{
-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $2 innocuous_$2
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $2 (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $2
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $2 ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined __stub_$2 || defined __stub___$2
-choke me
-#endif
-
-int
-main ()
-{
-return $2 ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_link "$LINENO"; then :
-  eval "$3=yes"
-else
-  eval "$3=no"
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-fi
-eval ac_res=\$$3
-	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
-} # ac_fn_cxx_check_func
-
-# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
-# -------------------------------------------------------
-# Tests whether HEADER exists, giving a warning if it cannot be compiled using
-# the include files in INCLUDES and setting the cache variable VAR
-# accordingly.
-ac_fn_c_check_header_mongrel ()
-{
-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  if eval \${$3+:} false; then :
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
-  $as_echo_n "(cached) " >&6
-fi
-eval ac_res=\$$3
-	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-else
-  # Is the header compilable?
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
-$as_echo_n "checking $2 usability... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$4
-#include <$2>
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_header_compiler=yes
-else
-  ac_header_compiler=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
-$as_echo "$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
-$as_echo_n "checking $2 presence... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <$2>
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
-  ac_header_preproc=yes
-else
-  ac_header_preproc=no
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
-$as_echo "$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((
-  yes:no: )
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
-$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
-    ;;
-  no:yes:* )
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
-$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2:     check for missing prerequisite headers?" >&5
-$as_echo "$as_me: WARNING: $2:     check for missing prerequisite headers?" >&2;}
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
-$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&5
-$as_echo "$as_me: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
-    ;;
-esac
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  eval "$3=\$ac_header_compiler"
-fi
-eval ac_res=\$$3
-	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-fi
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
-} # ac_fn_c_check_header_mongrel
-
-# ac_fn_c_try_run LINENO
-# ----------------------
-# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
-# that executables *can* be run.
-ac_fn_c_try_run ()
-{
-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  if { { ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_link") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
-  { { case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_try") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; }; then :
-  ac_retval=0
-else
-  $as_echo "$as_me: program exited with status $ac_status" >&5
-       $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       ac_retval=$ac_status
-fi
-  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-  as_fn_set_status $ac_retval
-
-} # ac_fn_c_try_run
-
-# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
-# -------------------------------------------------------
-# Tests whether HEADER exists and can be compiled using the include files in
-# INCLUDES, setting the cache variable VAR accordingly.
-ac_fn_c_check_header_compile ()
-{
-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$4
-#include <$2>
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  eval "$3=yes"
-else
-  eval "$3=no"
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-eval ac_res=\$$3
-	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
-} # ac_fn_c_check_header_compile
-cat >config.log <<_ACEOF
-This file contains any messages produced by compilers while
-running configure, to aid debugging if configure makes a mistake.
-
-It was created by $as_me, which was
-generated by GNU Autoconf 2.69.  Invocation command line was
-
-  $ $0 $@
-
-_ACEOF
-exec 5>>config.log
-{
-cat <<_ASUNAME
-## --------- ##
-## Platform. ##
-## --------- ##
-
-hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
-uname -m = `(uname -m) 2>/dev/null || echo unknown`
-uname -r = `(uname -r) 2>/dev/null || echo unknown`
-uname -s = `(uname -s) 2>/dev/null || echo unknown`
-uname -v = `(uname -v) 2>/dev/null || echo unknown`
-
-/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
-/bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
-
-/bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
-/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
-/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
-/usr/bin/hostinfo      = `(/usr/bin/hostinfo) 2>/dev/null      || echo unknown`
-/bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
-/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
-/bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
-
-_ASUNAME
-
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    $as_echo "PATH: $as_dir"
-  done
-IFS=$as_save_IFS
-
-} >&5
-
-cat >&5 <<_ACEOF
-
-
-## ----------- ##
-## Core tests. ##
-## ----------- ##
-
-_ACEOF
-
-
-# Keep a trace of the command line.
-# Strip out --no-create and --no-recursion so they do not pile up.
-# Strip out --silent because we don't want to record it for future runs.
-# Also quote any args containing shell meta-characters.
-# Make two passes to allow for proper duplicate-argument suppression.
-ac_configure_args=
-ac_configure_args0=
-ac_configure_args1=
-ac_must_keep_next=false
-for ac_pass in 1 2
-do
-  for ac_arg
-  do
-    case $ac_arg in
-    -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
-    -q | -quiet | --quiet | --quie | --qui | --qu | --q \
-    | -silent | --silent | --silen | --sile | --sil)
-      continue ;;
-    *\'*)
-      ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
-    esac
-    case $ac_pass in
-    1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
-    2)
-      as_fn_append ac_configure_args1 " '$ac_arg'"
-      if test $ac_must_keep_next = true; then
-	ac_must_keep_next=false # Got value, back to normal.
-      else
-	case $ac_arg in
-	  *=* | --config-cache | -C | -disable-* | --disable-* \
-	  | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
-	  | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
-	  | -with-* | --with-* | -without-* | --without-* | --x)
-	    case "$ac_configure_args0 " in
-	      "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
-	    esac
-	    ;;
-	  -* ) ac_must_keep_next=true ;;
-	esac
-      fi
-      as_fn_append ac_configure_args " '$ac_arg'"
-      ;;
-    esac
-  done
-done
-{ ac_configure_args0=; unset ac_configure_args0;}
-{ ac_configure_args1=; unset ac_configure_args1;}
-
-# When interrupted or exit'd, cleanup temporary files, and complete
-# config.log.  We remove comments because anyway the quotes in there
-# would cause problems or look ugly.
-# WARNING: Use '\'' to represent an apostrophe within the trap.
-# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
-trap 'exit_status=$?
-  # Save into config.log some information that might help in debugging.
-  {
-    echo
-
-    $as_echo "## ---------------- ##
-## Cache variables. ##
-## ---------------- ##"
-    echo
-    # The following way of writing the cache mishandles newlines in values,
-(
-  for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
-    eval ac_val=\$$ac_var
-    case $ac_val in #(
-    *${as_nl}*)
-      case $ac_var in #(
-      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
-$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
-      esac
-      case $ac_var in #(
-      _ | IFS | as_nl) ;; #(
-      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
-      *) { eval $ac_var=; unset $ac_var;} ;;
-      esac ;;
-    esac
-  done
-  (set) 2>&1 |
-    case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
-    *${as_nl}ac_space=\ *)
-      sed -n \
-	"s/'\''/'\''\\\\'\'''\''/g;
-	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
-      ;; #(
-    *)
-      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
-      ;;
-    esac |
-    sort
-)
-    echo
-
-    $as_echo "## ----------------- ##
-## Output variables. ##
-## ----------------- ##"
-    echo
-    for ac_var in $ac_subst_vars
-    do
-      eval ac_val=\$$ac_var
-      case $ac_val in
-      *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
-      esac
-      $as_echo "$ac_var='\''$ac_val'\''"
-    done | sort
-    echo
-
-    if test -n "$ac_subst_files"; then
-      $as_echo "## ------------------- ##
-## File substitutions. ##
-## ------------------- ##"
-      echo
-      for ac_var in $ac_subst_files
-      do
-	eval ac_val=\$$ac_var
-	case $ac_val in
-	*\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
-	esac
-	$as_echo "$ac_var='\''$ac_val'\''"
-      done | sort
-      echo
-    fi
-
-    if test -s confdefs.h; then
-      $as_echo "## ----------- ##
-## confdefs.h. ##
-## ----------- ##"
-      echo
-      cat confdefs.h
-      echo
-    fi
-    test "$ac_signal" != 0 &&
-      $as_echo "$as_me: caught signal $ac_signal"
-    $as_echo "$as_me: exit $exit_status"
-  } >&5
-  rm -f core *.core core.conftest.* &&
-    rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
-    exit $exit_status
-' 0
-for ac_signal in 1 2 13 15; do
-  trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
-done
-ac_signal=0
-
-# confdefs.h avoids OS command line length limits that DEFS can exceed.
-rm -f -r conftest* confdefs.h
-
-$as_echo "/* confdefs.h */" > confdefs.h
-
-# Predefined preprocessor variables.
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_NAME "$PACKAGE_NAME"
-_ACEOF
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
-_ACEOF
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_VERSION "$PACKAGE_VERSION"
-_ACEOF
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_STRING "$PACKAGE_STRING"
-_ACEOF
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
-_ACEOF
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_URL "$PACKAGE_URL"
-_ACEOF
-
-
-# Let the site file select an alternate cache file if it wants to.
-# Prefer an explicitly selected file to automatically selected ones.
-ac_site_file1=NONE
-ac_site_file2=NONE
-if test -n "$CONFIG_SITE"; then
-  # We do not want a PATH search for config.site.
-  case $CONFIG_SITE in #((
-    -*)  ac_site_file1=./$CONFIG_SITE;;
-    */*) ac_site_file1=$CONFIG_SITE;;
-    *)   ac_site_file1=./$CONFIG_SITE;;
-  esac
-elif test "x$prefix" != xNONE; then
-  ac_site_file1=$prefix/share/config.site
-  ac_site_file2=$prefix/etc/config.site
-else
-  ac_site_file1=$ac_default_prefix/share/config.site
-  ac_site_file2=$ac_default_prefix/etc/config.site
-fi
-for ac_site_file in "$ac_site_file1" "$ac_site_file2"
-do
-  test "x$ac_site_file" = xNONE && continue
-  if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
-$as_echo "$as_me: loading site script $ac_site_file" >&6;}
-    sed 's/^/| /' "$ac_site_file" >&5
-    . "$ac_site_file" \
-      || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "failed to load site script $ac_site_file
-See \`config.log' for more details" "$LINENO" 5; }
-  fi
-done
-
-if test -r "$cache_file"; then
-  # Some versions of bash will fail to source /dev/null (special files
-  # actually), so we avoid doing that.  DJGPP emulates it as a regular file.
-  if test /dev/null != "$cache_file" && test -f "$cache_file"; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
-$as_echo "$as_me: loading cache $cache_file" >&6;}
-    case $cache_file in
-      [\\/]* | ?:[\\/]* ) . "$cache_file";;
-      *)                      . "./$cache_file";;
-    esac
-  fi
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
-$as_echo "$as_me: creating cache $cache_file" >&6;}
-  >$cache_file
-fi
-
-# Check that the precious variables saved in the cache have kept the same
-# value.
-ac_cache_corrupted=false
-for ac_var in $ac_precious_vars; do
-  eval ac_old_set=\$ac_cv_env_${ac_var}_set
-  eval ac_new_set=\$ac_env_${ac_var}_set
-  eval ac_old_val=\$ac_cv_env_${ac_var}_value
-  eval ac_new_val=\$ac_env_${ac_var}_value
-  case $ac_old_set,$ac_new_set in
-    set,)
-      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
-$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
-      ac_cache_corrupted=: ;;
-    ,set)
-      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
-$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
-      ac_cache_corrupted=: ;;
-    ,);;
-    *)
-      if test "x$ac_old_val" != "x$ac_new_val"; then
-	# differences in whitespace do not lead to failure.
-	ac_old_val_w=`echo x $ac_old_val`
-	ac_new_val_w=`echo x $ac_new_val`
-	if test "$ac_old_val_w" != "$ac_new_val_w"; then
-	  { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
-$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
-	  ac_cache_corrupted=:
-	else
-	  { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
-$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
-	  eval $ac_var=\$ac_old_val
-	fi
-	{ $as_echo "$as_me:${as_lineno-$LINENO}:   former value:  \`$ac_old_val'" >&5
-$as_echo "$as_me:   former value:  \`$ac_old_val'" >&2;}
-	{ $as_echo "$as_me:${as_lineno-$LINENO}:   current value: \`$ac_new_val'" >&5
-$as_echo "$as_me:   current value: \`$ac_new_val'" >&2;}
-      fi;;
-  esac
-  # Pass precious variables to config.status.
-  if test "$ac_new_set" = set; then
-    case $ac_new_val in
-    *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
-    *) ac_arg=$ac_var=$ac_new_val ;;
-    esac
-    case " $ac_configure_args " in
-      *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
-      *) as_fn_append ac_configure_args " '$ac_arg'" ;;
-    esac
-  fi
-done
-if $ac_cache_corrupted; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-  { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
-$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
-  as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
-fi
-## -------------------- ##
-## Main body of script. ##
-## -------------------- ##
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-ac_config_headers="$ac_config_headers aconf.h"
-
-
-
-# Check whether --enable-a4-paper was given.
-if test "${enable_a4_paper+set}" = set; then :
-  enableval=$enable_a4_paper;
-fi
-
-if test "x$enable_a4_paper" = "xyes"; then :
-  $as_echo "#define A4_PAPER 1" >>confdefs.h
-
-fi
-
-# Check whether --enable-no-text-select was given.
-if test "${enable_no_text_select+set}" = set; then :
-  enableval=$enable_no_text_select;
-fi
-
-if test "x$enable_no_text_select" = "xyes"; then :
-  $as_echo "#define NO_TEXT_SELECT 1" >>confdefs.h
-
-fi
-
-# Check whether --enable-opi was given.
-if test "${enable_opi+set}" = set; then :
-  enableval=$enable_opi;
-fi
-
-if test "x$enable_opi" = "xyes"; then :
-  $as_echo "#define OPI_SUPPORT 1" >>confdefs.h
-
-fi
-
-# Check whether --enable-multithreaded was given.
-if test "${enable_multithreaded+set}" = set; then :
-  enableval=$enable_multithreaded;
-fi
-
-if test "x$enable_multithreaded" = "xyes"; then :
-  $as_echo "#define MULTITHREADED 1" >>confdefs.h
-
-fi
-
-# Check whether --enable-exceptions was given.
-if test "${enable_exceptions+set}" = set; then :
-  enableval=$enable_exceptions;
-fi
-
-if test "x$enable_exceptions" = "xyes"; then :
-  $as_echo "#define USE_EXCEPTIONS 1" >>confdefs.h
-
-fi
-
-# Check whether --enable-fixedpoint was given.
-if test "${enable_fixedpoint+set}" = set; then :
-  enableval=$enable_fixedpoint;
-fi
-
-if test "x$enable_fixedpoint" = "xyes"; then :
-  $as_echo "#define USE_FIXEDPOINT 1" >>confdefs.h
-
-fi
-
-# Check whether --enable-cmyk was given.
-if test "${enable_cmyk+set}" = set; then :
-  enableval=$enable_cmyk;
-fi
-
-if test "x$enable_cmyk" = "xyes"; then :
-  $as_echo "#define SPLASH_CMYK 1" >>confdefs.h
-
-fi
-
-
-# Check whether --with-appdef-dir was given.
-if test "${with_appdef_dir+set}" = set; then :
-  withval=$with_appdef_dir;
-fi
-
-if test "x$with_appdef_dir" != "xno"; then :
-  cat >>confdefs.h <<_ACEOF
-#define APPDEFDIR "$with_appdef_dir"
-_ACEOF
-
-fi
-
-if test "$sysconfdir" = '${prefix}/etc'; then
-  if test "x$prefix" = xNONE; then
-    system_xpdfrc="$ac_default_prefix/etc/xpdfrc"
-  else
-    system_xpdfrc="$prefix/etc/xpdfrc"
-  fi
-else
-  system_xpdfrc="$sysconfdir/xpdfrc"
-fi
-cat >>confdefs.h <<_ACEOF
-#define SYSTEM_XPDFRC "$system_xpdfrc"
-_ACEOF
-
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
-set dummy ${ac_tool_prefix}gcc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$CC"; then
-  ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_CC="${ac_tool_prefix}gcc"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_CC"; then
-  ac_ct_CC=$CC
-  # Extract the first word of "gcc", so it can be a program name with args.
-set dummy gcc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_CC+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_CC"; then
-  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_CC="gcc"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
-$as_echo "$ac_ct_CC" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-  if test "x$ac_ct_CC" = x; then
-    CC=""
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    CC=$ac_ct_CC
-  fi
-else
-  CC="$ac_cv_prog_CC"
-fi
-
-if test -z "$CC"; then
-          if test -n "$ac_tool_prefix"; then
-    # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
-set dummy ${ac_tool_prefix}cc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$CC"; then
-  ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_CC="${ac_tool_prefix}cc"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-  fi
-fi
-if test -z "$CC"; then
-  # Extract the first word of "cc", so it can be a program name with args.
-set dummy cc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$CC"; then
-  ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-  ac_prog_rejected=no
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
-       ac_prog_rejected=yes
-       continue
-     fi
-    ac_cv_prog_CC="cc"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-if test $ac_prog_rejected = yes; then
-  # We found a bogon in the path, so make sure we never use it.
-  set dummy $ac_cv_prog_CC
-  shift
-  if test $# != 0; then
-    # We chose a different compiler from the bogus one.
-    # However, it has the same basename, so the bogon will be chosen
-    # first if we set CC to just the basename; use the full file name.
-    shift
-    ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
-  fi
-fi
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$CC"; then
-  if test -n "$ac_tool_prefix"; then
-  for ac_prog in cl.exe
-  do
-    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$CC"; then
-  ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-    test -n "$CC" && break
-  done
-fi
-if test -z "$CC"; then
-  ac_ct_CC=$CC
-  for ac_prog in cl.exe
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_CC+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_CC"; then
-  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_CC="$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
-$as_echo "$ac_ct_CC" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-  test -n "$ac_ct_CC" && break
-done
-
-  if test "x$ac_ct_CC" = x; then
-    CC=""
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    CC=$ac_ct_CC
-  fi
-fi
-
-fi
-
-
-test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "no acceptable C compiler found in \$PATH
-See \`config.log' for more details" "$LINENO" 5; }
-
-# Provide some information about the compiler.
-$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
-set X $ac_compile
-ac_compiler=$2
-for ac_option in --version -v -V -qversion; do
-  { { ac_try="$ac_compiler $ac_option >&5"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_compiler $ac_option >&5") 2>conftest.err
-  ac_status=$?
-  if test -s conftest.err; then
-    sed '10a\
-... rest of stderr output deleted ...
-         10q' conftest.err >conftest.er1
-    cat conftest.er1 >&5
-  fi
-  rm -f conftest.er1 conftest.err
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }
-done
-
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
-# Try to create an executable without -o first, disregard a.out.
-# It will help us diagnose broken compilers, and finding out an intuition
-# of exeext.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
-$as_echo_n "checking whether the C compiler works... " >&6; }
-ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
-
-# The possible output files:
-ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
-
-ac_rmfiles=
-for ac_file in $ac_files
-do
-  case $ac_file in
-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
-    * ) ac_rmfiles="$ac_rmfiles $ac_file";;
-  esac
-done
-rm -f $ac_rmfiles
-
-if { { ac_try="$ac_link_default"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_link_default") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; then :
-  # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
-# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
-# in a Makefile.  We should not override ac_cv_exeext if it was cached,
-# so that the user can short-circuit this test for compilers unknown to
-# Autoconf.
-for ac_file in $ac_files ''
-do
-  test -f "$ac_file" || continue
-  case $ac_file in
-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
-	;;
-    [ab].out )
-	# We found the default executable, but exeext='' is most
-	# certainly right.
-	break;;
-    *.* )
-	if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
-	then :; else
-	   ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
-	fi
-	# We set ac_cv_exeext here because the later test for it is not
-	# safe: cross compilers may not add the suffix if given an `-o'
-	# argument, so we may need to know it at that point already.
-	# Even if this section looks crufty: it has the advantage of
-	# actually working.
-	break;;
-    * )
-	break;;
-  esac
-done
-test "$ac_cv_exeext" = no && ac_cv_exeext=
-
-else
-  ac_file=''
-fi
-if test -z "$ac_file"; then :
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-$as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error 77 "C compiler cannot create executables
-See \`config.log' for more details" "$LINENO" 5; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
-$as_echo_n "checking for C compiler default output file name... " >&6; }
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
-$as_echo "$ac_file" >&6; }
-ac_exeext=$ac_cv_exeext
-
-rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
-ac_clean_files=$ac_clean_files_save
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
-$as_echo_n "checking for suffix of executables... " >&6; }
-if { { ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_link") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; then :
-  # If both `conftest.exe' and `conftest' are `present' (well, observable)
-# catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
-# work properly (i.e., refer to `conftest.exe'), while it won't with
-# `rm'.
-for ac_file in conftest.exe conftest conftest.*; do
-  test -f "$ac_file" || continue
-  case $ac_file in
-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
-    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
-	  break;;
-    * ) break;;
-  esac
-done
-else
-  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details" "$LINENO" 5; }
-fi
-rm -f conftest conftest$ac_cv_exeext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
-$as_echo "$ac_cv_exeext" >&6; }
-
-rm -f conftest.$ac_ext
-EXEEXT=$ac_cv_exeext
-ac_exeext=$EXEEXT
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <stdio.h>
-int
-main ()
-{
-FILE *f = fopen ("conftest.out", "w");
- return ferror (f) || fclose (f) != 0;
-
-  ;
-  return 0;
-}
-_ACEOF
-ac_clean_files="$ac_clean_files conftest.out"
-# Check that the compiler produces executables we can run.  If not, either
-# the compiler is broken, or we cross compile.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
-$as_echo_n "checking whether we are cross compiling... " >&6; }
-if test "$cross_compiling" != yes; then
-  { { ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_link") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }
-  if { ac_try='./conftest$ac_cv_exeext'
-  { { case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_try") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; }; then
-    cross_compiling=no
-  else
-    if test "$cross_compiling" = maybe; then
-	cross_compiling=yes
-    else
-	{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot run C compiled programs.
-If you meant to cross compile, use \`--host'.
-See \`config.log' for more details" "$LINENO" 5; }
-    fi
-  fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
-$as_echo "$cross_compiling" >&6; }
-
-rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
-ac_clean_files=$ac_clean_files_save
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
-$as_echo_n "checking for suffix of object files... " >&6; }
-if ${ac_cv_objext+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.o conftest.obj
-if { { ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_compile") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; then :
-  for ac_file in conftest.o conftest.obj conftest.*; do
-  test -f "$ac_file" || continue;
-  case $ac_file in
-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
-    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
-       break;;
-  esac
-done
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot compute suffix of object files: cannot compile
-See \`config.log' for more details" "$LINENO" 5; }
-fi
-rm -f conftest.$ac_cv_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
-$as_echo "$ac_cv_objext" >&6; }
-OBJEXT=$ac_cv_objext
-ac_objext=$OBJEXT
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
-$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
-if ${ac_cv_c_compiler_gnu+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-#ifndef __GNUC__
-       choke me
-#endif
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_compiler_gnu=yes
-else
-  ac_compiler_gnu=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-ac_cv_c_compiler_gnu=$ac_compiler_gnu
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
-$as_echo "$ac_cv_c_compiler_gnu" >&6; }
-if test $ac_compiler_gnu = yes; then
-  GCC=yes
-else
-  GCC=
-fi
-ac_test_CFLAGS=${CFLAGS+set}
-ac_save_CFLAGS=$CFLAGS
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
-$as_echo_n "checking whether $CC accepts -g... " >&6; }
-if ${ac_cv_prog_cc_g+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_save_c_werror_flag=$ac_c_werror_flag
-   ac_c_werror_flag=yes
-   ac_cv_prog_cc_g=no
-   CFLAGS="-g"
-   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_prog_cc_g=yes
-else
-  CFLAGS=""
-      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-else
-  ac_c_werror_flag=$ac_save_c_werror_flag
-	 CFLAGS="-g"
-	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_prog_cc_g=yes
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-   ac_c_werror_flag=$ac_save_c_werror_flag
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
-$as_echo "$ac_cv_prog_cc_g" >&6; }
-if test "$ac_test_CFLAGS" = set; then
-  CFLAGS=$ac_save_CFLAGS
-elif test $ac_cv_prog_cc_g = yes; then
-  if test "$GCC" = yes; then
-    CFLAGS="-g -O2"
-  else
-    CFLAGS="-g"
-  fi
-else
-  if test "$GCC" = yes; then
-    CFLAGS="-O2"
-  else
-    CFLAGS=
-  fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
-$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
-if ${ac_cv_prog_cc_c89+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_cv_prog_cc_c89=no
-ac_save_CC=$CC
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <stdarg.h>
-#include <stdio.h>
-struct stat;
-/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
-struct buf { int x; };
-FILE * (*rcsopen) (struct buf *, struct stat *, int);
-static char *e (p, i)
-     char **p;
-     int i;
-{
-  return p[i];
-}
-static char *f (char * (*g) (char **, int), char **p, ...)
-{
-  char *s;
-  va_list v;
-  va_start (v,p);
-  s = g (p, va_arg (v,int));
-  va_end (v);
-  return s;
-}
-
-/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
-   function prototypes and stuff, but not '\xHH' hex character constants.
-   These don't provoke an error unfortunately, instead are silently treated
-   as 'x'.  The following induces an error, until -std is added to get
-   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
-   array size at least.  It's necessary to write '\x00'==0 to get something
-   that's true only with -std.  */
-int osf4_cc_array ['\x00' == 0 ? 1 : -1];
-
-/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
-   inside strings and character constants.  */
-#define FOO(x) 'x'
-int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
-
-int test (int i, double x);
-struct s1 {int (*f) (int a);};
-struct s2 {int (*f) (double a);};
-int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
-int argc;
-char **argv;
-int
-main ()
-{
-return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
-  ;
-  return 0;
-}
-_ACEOF
-for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
-	-Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
-do
-  CC="$ac_save_CC $ac_arg"
-  if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_prog_cc_c89=$ac_arg
-fi
-rm -f core conftest.err conftest.$ac_objext
-  test "x$ac_cv_prog_cc_c89" != "xno" && break
-done
-rm -f conftest.$ac_ext
-CC=$ac_save_CC
-
-fi
-# AC_CACHE_VAL
-case "x$ac_cv_prog_cc_c89" in
-  x)
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
-$as_echo "none needed" >&6; } ;;
-  xno)
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
-$as_echo "unsupported" >&6; } ;;
-  *)
-    CC="$CC $ac_cv_prog_cc_c89"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
-$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
-esac
-if test "x$ac_cv_prog_cc_c89" != xno; then :
-
-fi
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing strerror" >&5
-$as_echo_n "checking for library containing strerror... " >&6; }
-if ${ac_cv_search_strerror+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_func_search_save_LIBS=$LIBS
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char strerror ();
-int
-main ()
-{
-return strerror ();
-  ;
-  return 0;
-}
-_ACEOF
-for ac_lib in '' cposix; do
-  if test -z "$ac_lib"; then
-    ac_res="none required"
-  else
-    ac_res=-l$ac_lib
-    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
-  fi
-  if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_search_strerror=$ac_res
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext
-  if ${ac_cv_search_strerror+:} false; then :
-  break
-fi
-done
-if ${ac_cv_search_strerror+:} false; then :
-
-else
-  ac_cv_search_strerror=no
-fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_strerror" >&5
-$as_echo "$ac_cv_search_strerror" >&6; }
-ac_res=$ac_cv_search_strerror
-if test "$ac_res" != no; then :
-  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
-
-fi
-
-   case $ac_cv_prog_cc_stdc in #(
-  no) :
-    ac_cv_prog_cc_c99=no; ac_cv_prog_cc_c89=no ;; #(
-  *) :
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C99" >&5
-$as_echo_n "checking for $CC option to accept ISO C99... " >&6; }
-if ${ac_cv_prog_cc_c99+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_cv_prog_cc_c99=no
-ac_save_CC=$CC
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <stdarg.h>
-#include <stdbool.h>
-#include <stdlib.h>
-#include <wchar.h>
-#include <stdio.h>
-
-// Check varargs macros.  These examples are taken from C99 6.10.3.5.
-#define debug(...) fprintf (stderr, __VA_ARGS__)
-#define showlist(...) puts (#__VA_ARGS__)
-#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__))
-static void
-test_varargs_macros (void)
-{
-  int x = 1234;
-  int y = 5678;
-  debug ("Flag");
-  debug ("X = %d\n", x);
-  showlist (The first, second, and third items.);
-  report (x>y, "x is %d but y is %d", x, y);
-}
-
-// Check long long types.
-#define BIG64 18446744073709551615ull
-#define BIG32 4294967295ul
-#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0)
-#if !BIG_OK
-  your preprocessor is broken;
-#endif
-#if BIG_OK
-#else
-  your preprocessor is broken;
-#endif
-static long long int bignum = -9223372036854775807LL;
-static unsigned long long int ubignum = BIG64;
-
-struct incomplete_array
-{
-  int datasize;
-  double data[];
-};
-
-struct named_init {
-  int number;
-  const wchar_t *name;
-  double average;
-};
-
-typedef const char *ccp;
-
-static inline int
-test_restrict (ccp restrict text)
-{
-  // See if C++-style comments work.
-  // Iterate through items via the restricted pointer.
-  // Also check for declarations in for loops.
-  for (unsigned int i = 0; *(text+i) != '\0'; ++i)
-    continue;
-  return 0;
-}
-
-// Check varargs and va_copy.
-static void
-test_varargs (const char *format, ...)
-{
-  va_list args;
-  va_start (args, format);
-  va_list args_copy;
-  va_copy (args_copy, args);
-
-  const char *str;
-  int number;
-  float fnumber;
-
-  while (*format)
-    {
-      switch (*format++)
-	{
-	case 's': // string
-	  str = va_arg (args_copy, const char *);
-	  break;
-	case 'd': // int
-	  number = va_arg (args_copy, int);
-	  break;
-	case 'f': // float
-	  fnumber = va_arg (args_copy, double);
-	  break;
-	default:
-	  break;
-	}
-    }
-  va_end (args_copy);
-  va_end (args);
-}
-
-int
-main ()
-{
-
-  // Check bool.
-  _Bool success = false;
-
-  // Check restrict.
-  if (test_restrict ("String literal") == 0)
-    success = true;
-  char *restrict newvar = "Another string";
-
-  // Check varargs.
-  test_varargs ("s, d' f .", "string", 65, 34.234);
-  test_varargs_macros ();
-
-  // Check flexible array members.
-  struct incomplete_array *ia =
-    malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10));
-  ia->datasize = 10;
-  for (int i = 0; i < ia->datasize; ++i)
-    ia->data[i] = i * 1.234;
-
-  // Check named initializers.
-  struct named_init ni = {
-    .number = 34,
-    .name = L"Test wide string",
-    .average = 543.34343,
-  };
-
-  ni.number = 58;
-
-  int dynamic_array[ni.number];
-  dynamic_array[ni.number - 1] = 543;
-
-  // work around unused variable warnings
-  return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x'
-	  || dynamic_array[ni.number - 1] != 543);
-
-  ;
-  return 0;
-}
-_ACEOF
-for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -D_STDC_C99= -qlanglvl=extc99
-do
-  CC="$ac_save_CC $ac_arg"
-  if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_prog_cc_c99=$ac_arg
-fi
-rm -f core conftest.err conftest.$ac_objext
-  test "x$ac_cv_prog_cc_c99" != "xno" && break
-done
-rm -f conftest.$ac_ext
-CC=$ac_save_CC
-
-fi
-# AC_CACHE_VAL
-case "x$ac_cv_prog_cc_c99" in
-  x)
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
-$as_echo "none needed" >&6; } ;;
-  xno)
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
-$as_echo "unsupported" >&6; } ;;
-  *)
-    CC="$CC $ac_cv_prog_cc_c99"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5
-$as_echo "$ac_cv_prog_cc_c99" >&6; } ;;
-esac
-if test "x$ac_cv_prog_cc_c99" != xno; then :
-  ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
-$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
-if ${ac_cv_prog_cc_c89+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_cv_prog_cc_c89=no
-ac_save_CC=$CC
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <stdarg.h>
-#include <stdio.h>
-struct stat;
-/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
-struct buf { int x; };
-FILE * (*rcsopen) (struct buf *, struct stat *, int);
-static char *e (p, i)
-     char **p;
-     int i;
-{
-  return p[i];
-}
-static char *f (char * (*g) (char **, int), char **p, ...)
-{
-  char *s;
-  va_list v;
-  va_start (v,p);
-  s = g (p, va_arg (v,int));
-  va_end (v);
-  return s;
-}
-
-/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
-   function prototypes and stuff, but not '\xHH' hex character constants.
-   These don't provoke an error unfortunately, instead are silently treated
-   as 'x'.  The following induces an error, until -std is added to get
-   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
-   array size at least.  It's necessary to write '\x00'==0 to get something
-   that's true only with -std.  */
-int osf4_cc_array ['\x00' == 0 ? 1 : -1];
-
-/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
-   inside strings and character constants.  */
-#define FOO(x) 'x'
-int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
-
-int test (int i, double x);
-struct s1 {int (*f) (int a);};
-struct s2 {int (*f) (double a);};
-int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
-int argc;
-char **argv;
-int
-main ()
-{
-return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
-  ;
-  return 0;
-}
-_ACEOF
-for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
-	-Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
-do
-  CC="$ac_save_CC $ac_arg"
-  if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_prog_cc_c89=$ac_arg
-fi
-rm -f core conftest.err conftest.$ac_objext
-  test "x$ac_cv_prog_cc_c89" != "xno" && break
-done
-rm -f conftest.$ac_ext
-CC=$ac_save_CC
-
-fi
-# AC_CACHE_VAL
-case "x$ac_cv_prog_cc_c89" in
-  x)
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
-$as_echo "none needed" >&6; } ;;
-  xno)
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
-$as_echo "unsupported" >&6; } ;;
-  *)
-    CC="$CC $ac_cv_prog_cc_c89"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
-$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
-esac
-if test "x$ac_cv_prog_cc_c89" != xno; then :
-  ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89
-else
-  ac_cv_prog_cc_stdc=no
-fi
-
-fi
- ;;
-esac
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO Standard C" >&5
-$as_echo_n "checking for $CC option to accept ISO Standard C... " >&6; }
-  if ${ac_cv_prog_cc_stdc+:} false; then :
-  $as_echo_n "(cached) " >&6
-fi
-
-  case $ac_cv_prog_cc_stdc in #(
-  no) :
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
-$as_echo "unsupported" >&6; } ;; #(
-  '') :
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
-$as_echo "none needed" >&6; } ;; #(
-  *) :
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_stdc" >&5
-$as_echo "$ac_cv_prog_cc_stdc" >&6; } ;;
-esac
-
-#if test -z "$CXX" -a "$CC" = "gcc"; then
-#  CXX="gcc"
-#fi
-ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-if test -z "$CXX"; then
-  if test -n "$CCC"; then
-    CXX=$CCC
-  else
-    if test -n "$ac_tool_prefix"; then
-  for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
-  do
-    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CXX+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$CXX"; then
-  ac_cv_prog_CXX="$CXX" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-CXX=$ac_cv_prog_CXX
-if test -n "$CXX"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5
-$as_echo "$CXX" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-    test -n "$CXX" && break
-  done
-fi
-if test -z "$CXX"; then
-  ac_ct_CXX=$CXX
-  for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_CXX+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_CXX"; then
-  ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_CXX="$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
-if test -n "$ac_ct_CXX"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5
-$as_echo "$ac_ct_CXX" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-  test -n "$ac_ct_CXX" && break
-done
-
-  if test "x$ac_ct_CXX" = x; then
-    CXX="g++"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    CXX=$ac_ct_CXX
-  fi
-fi
-
-  fi
-fi
-# Provide some information about the compiler.
-$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5
-set X $ac_compile
-ac_compiler=$2
-for ac_option in --version -v -V -qversion; do
-  { { ac_try="$ac_compiler $ac_option >&5"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_compiler $ac_option >&5") 2>conftest.err
-  ac_status=$?
-  if test -s conftest.err; then
-    sed '10a\
-... rest of stderr output deleted ...
-         10q' conftest.err >conftest.er1
-    cat conftest.er1 >&5
-  fi
-  rm -f conftest.er1 conftest.err
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }
-done
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5
-$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; }
-if ${ac_cv_cxx_compiler_gnu+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-#ifndef __GNUC__
-       choke me
-#endif
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
-  ac_compiler_gnu=yes
-else
-  ac_compiler_gnu=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5
-$as_echo "$ac_cv_cxx_compiler_gnu" >&6; }
-if test $ac_compiler_gnu = yes; then
-  GXX=yes
-else
-  GXX=
-fi
-ac_test_CXXFLAGS=${CXXFLAGS+set}
-ac_save_CXXFLAGS=$CXXFLAGS
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5
-$as_echo_n "checking whether $CXX accepts -g... " >&6; }
-if ${ac_cv_prog_cxx_g+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_save_cxx_werror_flag=$ac_cxx_werror_flag
-   ac_cxx_werror_flag=yes
-   ac_cv_prog_cxx_g=no
-   CXXFLAGS="-g"
-   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
-  ac_cv_prog_cxx_g=yes
-else
-  CXXFLAGS=""
-      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
-
-else
-  ac_cxx_werror_flag=$ac_save_cxx_werror_flag
-	 CXXFLAGS="-g"
-	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
-  ac_cv_prog_cxx_g=yes
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-   ac_cxx_werror_flag=$ac_save_cxx_werror_flag
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5
-$as_echo "$ac_cv_prog_cxx_g" >&6; }
-if test "$ac_test_CXXFLAGS" = set; then
-  CXXFLAGS=$ac_save_CXXFLAGS
-elif test $ac_cv_prog_cxx_g = yes; then
-  if test "$GXX" = yes; then
-    CXXFLAGS="-g -O2"
-  else
-    CXXFLAGS="-g"
-  fi
-else
-  if test "$GXX" = yes; then
-    CXXFLAGS="-O2"
-  else
-    CXXFLAGS=
-  fi
-fi
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-ac_aux_dir=
-for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
-  if test -f "$ac_dir/install-sh"; then
-    ac_aux_dir=$ac_dir
-    ac_install_sh="$ac_aux_dir/install-sh -c"
-    break
-  elif test -f "$ac_dir/install.sh"; then
-    ac_aux_dir=$ac_dir
-    ac_install_sh="$ac_aux_dir/install.sh -c"
-    break
-  elif test -f "$ac_dir/shtool"; then
-    ac_aux_dir=$ac_dir
-    ac_install_sh="$ac_aux_dir/shtool install -c"
-    break
-  fi
-done
-if test -z "$ac_aux_dir"; then
-  as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
-fi
-
-# These three variables are undocumented and unsupported,
-# and are intended to be withdrawn in a future Autoconf release.
-# They can cause serious problems if a builder's source tree is in a directory
-# whose full name contains unusual characters.
-ac_config_guess="$SHELL $ac_aux_dir/config.guess"  # Please don't use this var.
-ac_config_sub="$SHELL $ac_aux_dir/config.sub"  # Please don't use this var.
-ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
-
-
-# Find a good install program.  We prefer a C program (faster),
-# so one script is as good as another.  But avoid the broken or
-# incompatible versions:
-# SysV /etc/install, /usr/sbin/install
-# SunOS /usr/etc/install
-# IRIX /sbin/install
-# AIX /bin/install
-# AmigaOS /C/install, which installs bootblocks on floppy discs
-# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
-# AFS /usr/afsws/bin/install, which mishandles nonexistent args
-# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
-# OS/2's system install, which has a completely different semantic
-# ./install, which can be erroneously created by make from ./install.sh.
-# Reject install programs that cannot install multiple files.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
-$as_echo_n "checking for a BSD-compatible install... " >&6; }
-if test -z "$INSTALL"; then
-if ${ac_cv_path_install+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    # Account for people who put trailing slashes in PATH elements.
-case $as_dir/ in #((
-  ./ | .// | /[cC]/* | \
-  /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
-  ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
-  /usr/ucb/* ) ;;
-  *)
-    # OSF1 and SCO ODT 3.0 have their own names for install.
-    # Don't use installbsd from OSF since it installs stuff as root
-    # by default.
-    for ac_prog in ginstall scoinst install; do
-      for ac_exec_ext in '' $ac_executable_extensions; do
-	if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
-	  if test $ac_prog = install &&
-	    grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
-	    # AIX install.  It has an incompatible calling convention.
-	    :
-	  elif test $ac_prog = install &&
-	    grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
-	    # program-specific install script used by HP pwplus--don't use.
-	    :
-	  else
-	    rm -rf conftest.one conftest.two conftest.dir
-	    echo one > conftest.one
-	    echo two > conftest.two
-	    mkdir conftest.dir
-	    if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
-	      test -s conftest.one && test -s conftest.two &&
-	      test -s conftest.dir/conftest.one &&
-	      test -s conftest.dir/conftest.two
-	    then
-	      ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
-	      break 3
-	    fi
-	  fi
-	fi
-      done
-    done
-    ;;
-esac
-
-  done
-IFS=$as_save_IFS
-
-rm -rf conftest.one conftest.two conftest.dir
-
-fi
-  if test "${ac_cv_path_install+set}" = set; then
-    INSTALL=$ac_cv_path_install
-  else
-    # As a last resort, use the slow shell script.  Don't cache a
-    # value for INSTALL within a source directory, because that will
-    # break other packages using the cache if that directory is
-    # removed, or if the value is a relative name.
-    INSTALL=$ac_install_sh
-  fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
-$as_echo "$INSTALL" >&6; }
-
-# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
-# It thinks the first close brace ends the variable substitution.
-test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
-
-test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
-
-test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
-
-if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
-set dummy ${ac_tool_prefix}ranlib; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_RANLIB+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$RANLIB"; then
-  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-RANLIB=$ac_cv_prog_RANLIB
-if test -n "$RANLIB"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
-$as_echo "$RANLIB" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_RANLIB"; then
-  ac_ct_RANLIB=$RANLIB
-  # Extract the first word of "ranlib", so it can be a program name with args.
-set dummy ranlib; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_RANLIB"; then
-  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_RANLIB="ranlib"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
-if test -n "$ac_ct_RANLIB"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
-$as_echo "$ac_ct_RANLIB" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-  if test "x$ac_ct_RANLIB" = x; then
-    RANLIB=":"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    RANLIB=$ac_ct_RANLIB
-  fi
-else
-  RANLIB="$ac_cv_prog_RANLIB"
-fi
-
-
-EXE=""
-LIBPREFIX="lib"
-AR="ar rc"
-UP_DIR=""
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for OS/2 (with EMX)" >&5
-$as_echo_n "checking for OS/2 (with EMX)... " >&6; }
-if ${xpdf_cv_sys_os2+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-__EMX__
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  xpdf_cv_sys_os2=yes
-else
-  xpdf_cv_sys_os2=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xpdf_cv_sys_os2" >&5
-$as_echo "$xpdf_cv_sys_os2" >&6; }
-if test "$xpdf_cv_sys_os2" = yes; then
-  EXE=".exe"
-  LIBPREFIX=""
-  AR="ar -rc"
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for DOS (with DJGPP)" >&5
-$as_echo_n "checking for DOS (with DJGPP)... " >&6; }
-if ${xpdf_cv_sys_dos+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-__DJGPP__
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  xpdf_cv_sys_dos=yes
-else
-  xpdf_cv_sys_dos=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xpdf_cv_sys_dos" >&5
-$as_echo "$xpdf_cv_sys_dos" >&6; }
-if test "$xpdf_cv_sys_dos" = yes; then
-  EXE=".exe"
-  LIBPREFIX="lib"
-  AR="ar -rc"
-  UP_DIR="../"
-fi
-
-
-
-
-
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
-$as_echo_n "checking how to run the C preprocessor... " >&6; }
-# On Suns, sometimes $CPP names a directory.
-if test -n "$CPP" && test -d "$CPP"; then
-  CPP=
-fi
-if test -z "$CPP"; then
-  if ${ac_cv_prog_CPP+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-      # Double quotes because CPP needs to be expanded
-    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
-    do
-      ac_preproc_ok=false
-for ac_c_preproc_warn_flag in '' yes
-do
-  # Use a header file that comes with gcc, so configuring glibc
-  # with a fresh cross-compiler works.
-  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-  # <limits.h> exists even on freestanding compilers.
-  # On the NeXT, cc -E runs the code through the compiler's parser,
-  # not just through cpp. "Syntax error" is here to catch this case.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-		     Syntax error
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
-
-else
-  # Broken: fails on valid input.
-continue
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
-  # OK, works on sane cases.  Now check whether nonexistent headers
-  # can be detected and how.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <ac_nonexistent.h>
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
-  # Broken: success on invalid input.
-continue
-else
-  # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.i conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then :
-  break
-fi
-
-    done
-    ac_cv_prog_CPP=$CPP
-
-fi
-  CPP=$ac_cv_prog_CPP
-else
-  ac_cv_prog_CPP=$CPP
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
-$as_echo "$CPP" >&6; }
-ac_preproc_ok=false
-for ac_c_preproc_warn_flag in '' yes
-do
-  # Use a header file that comes with gcc, so configuring glibc
-  # with a fresh cross-compiler works.
-  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-  # <limits.h> exists even on freestanding compilers.
-  # On the NeXT, cc -E runs the code through the compiler's parser,
-  # not just through cpp. "Syntax error" is here to catch this case.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-		     Syntax error
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
-
-else
-  # Broken: fails on valid input.
-continue
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
-  # OK, works on sane cases.  Now check whether nonexistent headers
-  # can be detected and how.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <ac_nonexistent.h>
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
-  # Broken: success on invalid input.
-continue
-else
-  # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.i conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then :
-
-else
-  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details" "$LINENO" 5; }
-fi
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for X" >&5
-$as_echo_n "checking for X... " >&6; }
-
-
-# Check whether --with-x was given.
-if test "${with_x+set}" = set; then :
-  withval=$with_x;
-fi
-
-# $have_x is `yes', `no', `disabled', or empty when we do not yet know.
-if test "x$with_x" = xno; then
-  # The user explicitly disabled X.
-  have_x=disabled
-else
-  case $x_includes,$x_libraries in #(
-    *\'*) as_fn_error $? "cannot use X directory names containing '" "$LINENO" 5;; #(
-    *,NONE | NONE,*) if ${ac_cv_have_x+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  # One or both of the vars are not set, and there is no cached value.
-ac_x_includes=no ac_x_libraries=no
-rm -f -r conftest.dir
-if mkdir conftest.dir; then
-  cd conftest.dir
-  cat >Imakefile <<'_ACEOF'
-incroot:
-	@echo incroot='${INCROOT}'
-usrlibdir:
-	@echo usrlibdir='${USRLIBDIR}'
-libdir:
-	@echo libdir='${LIBDIR}'
-_ACEOF
-  if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then
-    # GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
-    for ac_var in incroot usrlibdir libdir; do
-      eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`"
-    done
-    # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
-    for ac_extension in a so sl dylib la dll; do
-      if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" &&
-	 test -f "$ac_im_libdir/libX11.$ac_extension"; then
-	ac_im_usrlibdir=$ac_im_libdir; break
-      fi
-    done
-    # Screen out bogus values from the imake configuration.  They are
-    # bogus both because they are the default anyway, and because
-    # using them would break gcc on systems where it needs fixed includes.
-    case $ac_im_incroot in
-	/usr/include) ac_x_includes= ;;
-	*) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
-    esac
-    case $ac_im_usrlibdir in
-	/usr/lib | /usr/lib64 | /lib | /lib64) ;;
-	*) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
-    esac
-  fi
-  cd ..
-  rm -f -r conftest.dir
-fi
-
-# Standard set of common directories for X headers.
-# Check X11 before X11Rn because it is often a symlink to the current release.
-ac_x_header_dirs='
-/usr/X11/include
-/usr/X11R7/include
-/usr/X11R6/include
-/usr/X11R5/include
-/usr/X11R4/include
-
-/usr/include/X11
-/usr/include/X11R7
-/usr/include/X11R6
-/usr/include/X11R5
-/usr/include/X11R4
-
-/usr/local/X11/include
-/usr/local/X11R7/include
-/usr/local/X11R6/include
-/usr/local/X11R5/include
-/usr/local/X11R4/include
-
-/usr/local/include/X11
-/usr/local/include/X11R7
-/usr/local/include/X11R6
-/usr/local/include/X11R5
-/usr/local/include/X11R4
-
-/usr/X386/include
-/usr/x386/include
-/usr/XFree86/include/X11
-
-/usr/include
-/usr/local/include
-/usr/unsupported/include
-/usr/athena/include
-/usr/local/x11r5/include
-/usr/lpp/Xamples/include
-
-/usr/openwin/include
-/usr/openwin/share/include'
-
-if test "$ac_x_includes" = no; then
-  # Guess where to find include files, by looking for Xlib.h.
-  # First, try using that file with no special directory specified.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <X11/Xlib.h>
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
-  # We can compile using X headers with no special include directory.
-ac_x_includes=
-else
-  for ac_dir in $ac_x_header_dirs; do
-  if test -r "$ac_dir/X11/Xlib.h"; then
-    ac_x_includes=$ac_dir
-    break
-  fi
-done
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-fi # $ac_x_includes = no
-
-if test "$ac_x_libraries" = no; then
-  # Check for the libraries.
-  # See if we find them without any special options.
-  # Don't add to $LIBS permanently.
-  ac_save_LIBS=$LIBS
-  LIBS="-lX11 $LIBS"
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <X11/Xlib.h>
-int
-main ()
-{
-XrmInitialize ()
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  LIBS=$ac_save_LIBS
-# We can link X programs with no special library path.
-ac_x_libraries=
-else
-  LIBS=$ac_save_LIBS
-for ac_dir in `$as_echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
-do
-  # Don't even attempt the hair of trying to link an X program!
-  for ac_extension in a so sl dylib la dll; do
-    if test -r "$ac_dir/libX11.$ac_extension"; then
-      ac_x_libraries=$ac_dir
-      break 2
-    fi
-  done
-done
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-fi # $ac_x_libraries = no
-
-case $ac_x_includes,$ac_x_libraries in #(
-  no,* | *,no | *\'*)
-    # Didn't find X, or a directory has "'" in its name.
-    ac_cv_have_x="have_x=no";; #(
-  *)
-    # Record where we found X for the cache.
-    ac_cv_have_x="have_x=yes\
-	ac_x_includes='$ac_x_includes'\
-	ac_x_libraries='$ac_x_libraries'"
-esac
-fi
-;; #(
-    *) have_x=yes;;
-  esac
-  eval "$ac_cv_have_x"
-fi # $with_x != no
-
-if test "$have_x" != yes; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_x" >&5
-$as_echo "$have_x" >&6; }
-  no_x=yes
-else
-  # If each of the values was on the command line, it overrides each guess.
-  test "x$x_includes" = xNONE && x_includes=$ac_x_includes
-  test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
-  # Update the cache value to reflect the command line values.
-  ac_cv_have_x="have_x=yes\
-	ac_x_includes='$x_includes'\
-	ac_x_libraries='$x_libraries'"
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: libraries $x_libraries, headers $x_includes" >&5
-$as_echo "libraries $x_libraries, headers $x_includes" >&6; }
-fi
-
-if test "$no_x" = yes; then
-  # Not all programs may use this symbol, but it does not hurt to define it.
-
-$as_echo "#define X_DISPLAY_MISSING 1" >>confdefs.h
-
-  X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
-else
-  if test -n "$x_includes"; then
-    X_CFLAGS="$X_CFLAGS -I$x_includes"
-  fi
-
-  # It would also be nice to do this for all -L options, not just this one.
-  if test -n "$x_libraries"; then
-    X_LIBS="$X_LIBS -L$x_libraries"
-    # For Solaris; some versions of Sun CC require a space after -R and
-    # others require no space.  Words are not sufficient . . . .
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -R must be followed by a space" >&5
-$as_echo_n "checking whether -R must be followed by a space... " >&6; }
-    ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
-    ac_xsave_c_werror_flag=$ac_c_werror_flag
-    ac_c_werror_flag=yes
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-       X_LIBS="$X_LIBS -R$x_libraries"
-else
-  LIBS="$ac_xsave_LIBS -R $x_libraries"
-       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-	  X_LIBS="$X_LIBS -R $x_libraries"
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: neither works" >&5
-$as_echo "neither works" >&6; }
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-    ac_c_werror_flag=$ac_xsave_c_werror_flag
-    LIBS=$ac_xsave_LIBS
-  fi
-
-  # Check for system-dependent libraries X programs must link with.
-  # Do this before checking for the system-independent R6 libraries
-  # (-lICE), since we may need -lsocket or whatever for X linking.
-
-  if test "$ISC" = yes; then
-    X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
-  else
-    # Martyn Johnson says this is needed for Ultrix, if the X
-    # libraries were built with DECnet support.  And Karl Berry says
-    # the Alpha needs dnet_stub (dnet does not exist).
-    ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char XOpenDisplay ();
-int
-main ()
-{
-return XOpenDisplay ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dnet_ntoa in -ldnet" >&5
-$as_echo_n "checking for dnet_ntoa in -ldnet... " >&6; }
-if ${ac_cv_lib_dnet_dnet_ntoa+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldnet  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char dnet_ntoa ();
-int
-main ()
-{
-return dnet_ntoa ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_dnet_dnet_ntoa=yes
-else
-  ac_cv_lib_dnet_dnet_ntoa=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
-$as_echo "$ac_cv_lib_dnet_dnet_ntoa" >&6; }
-if test "x$ac_cv_lib_dnet_dnet_ntoa" = xyes; then :
-  X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
-fi
-
-    if test $ac_cv_lib_dnet_dnet_ntoa = no; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dnet_ntoa in -ldnet_stub" >&5
-$as_echo_n "checking for dnet_ntoa in -ldnet_stub... " >&6; }
-if ${ac_cv_lib_dnet_stub_dnet_ntoa+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldnet_stub  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char dnet_ntoa ();
-int
-main ()
-{
-return dnet_ntoa ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_dnet_stub_dnet_ntoa=yes
-else
-  ac_cv_lib_dnet_stub_dnet_ntoa=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
-$as_echo "$ac_cv_lib_dnet_stub_dnet_ntoa" >&6; }
-if test "x$ac_cv_lib_dnet_stub_dnet_ntoa" = xyes; then :
-  X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
-fi
-
-    fi
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-    LIBS="$ac_xsave_LIBS"
-
-    # msh at cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
-    # to get the SysV transport functions.
-    # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
-    # needs -lnsl.
-    # The nsl library prevents programs from opening the X display
-    # on Irix 5.2, according to T.E. Dickey.
-    # The functions gethostbyname, getservbyname, and inet_addr are
-    # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
-    ac_fn_c_check_func "$LINENO" "gethostbyname" "ac_cv_func_gethostbyname"
-if test "x$ac_cv_func_gethostbyname" = xyes; then :
-
-fi
-
-    if test $ac_cv_func_gethostbyname = no; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnsl" >&5
-$as_echo_n "checking for gethostbyname in -lnsl... " >&6; }
-if ${ac_cv_lib_nsl_gethostbyname+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lnsl  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char gethostbyname ();
-int
-main ()
-{
-return gethostbyname ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_nsl_gethostbyname=yes
-else
-  ac_cv_lib_nsl_gethostbyname=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyname" >&5
-$as_echo "$ac_cv_lib_nsl_gethostbyname" >&6; }
-if test "x$ac_cv_lib_nsl_gethostbyname" = xyes; then :
-  X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
-fi
-
-      if test $ac_cv_lib_nsl_gethostbyname = no; then
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lbsd" >&5
-$as_echo_n "checking for gethostbyname in -lbsd... " >&6; }
-if ${ac_cv_lib_bsd_gethostbyname+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lbsd  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char gethostbyname ();
-int
-main ()
-{
-return gethostbyname ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_bsd_gethostbyname=yes
-else
-  ac_cv_lib_bsd_gethostbyname=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bsd_gethostbyname" >&5
-$as_echo "$ac_cv_lib_bsd_gethostbyname" >&6; }
-if test "x$ac_cv_lib_bsd_gethostbyname" = xyes; then :
-  X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
-fi
-
-      fi
-    fi
-
-    # lieder at skyler.mavd.honeywell.com says without -lsocket,
-    # socket/setsockopt and other routines are undefined under SCO ODT
-    # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
-    # on later versions), says Simon Leinen: it contains gethostby*
-    # variants that don't use the name server (or something).  -lsocket
-    # must be given before -lnsl if both are needed.  We assume that
-    # if connect needs -lnsl, so does gethostbyname.
-    ac_fn_c_check_func "$LINENO" "connect" "ac_cv_func_connect"
-if test "x$ac_cv_func_connect" = xyes; then :
-
-fi
-
-    if test $ac_cv_func_connect = no; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for connect in -lsocket" >&5
-$as_echo_n "checking for connect in -lsocket... " >&6; }
-if ${ac_cv_lib_socket_connect+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char connect ();
-int
-main ()
-{
-return connect ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_socket_connect=yes
-else
-  ac_cv_lib_socket_connect=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_connect" >&5
-$as_echo "$ac_cv_lib_socket_connect" >&6; }
-if test "x$ac_cv_lib_socket_connect" = xyes; then :
-  X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
-fi
-
-    fi
-
-    # Guillermo Gomez says -lposix is necessary on A/UX.
-    ac_fn_c_check_func "$LINENO" "remove" "ac_cv_func_remove"
-if test "x$ac_cv_func_remove" = xyes; then :
-
-fi
-
-    if test $ac_cv_func_remove = no; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for remove in -lposix" >&5
-$as_echo_n "checking for remove in -lposix... " >&6; }
-if ${ac_cv_lib_posix_remove+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lposix  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char remove ();
-int
-main ()
-{
-return remove ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_posix_remove=yes
-else
-  ac_cv_lib_posix_remove=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_posix_remove" >&5
-$as_echo "$ac_cv_lib_posix_remove" >&6; }
-if test "x$ac_cv_lib_posix_remove" = xyes; then :
-  X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
-fi
-
-    fi
-
-    # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
-    ac_fn_c_check_func "$LINENO" "shmat" "ac_cv_func_shmat"
-if test "x$ac_cv_func_shmat" = xyes; then :
-
-fi
-
-    if test $ac_cv_func_shmat = no; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shmat in -lipc" >&5
-$as_echo_n "checking for shmat in -lipc... " >&6; }
-if ${ac_cv_lib_ipc_shmat+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lipc  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char shmat ();
-int
-main ()
-{
-return shmat ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_ipc_shmat=yes
-else
-  ac_cv_lib_ipc_shmat=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ipc_shmat" >&5
-$as_echo "$ac_cv_lib_ipc_shmat" >&6; }
-if test "x$ac_cv_lib_ipc_shmat" = xyes; then :
-  X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
-fi
-
-    fi
-  fi
-
-  # Check for libraries that X11R6 Xt/Xaw programs need.
-  ac_save_LDFLAGS=$LDFLAGS
-  test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
-  # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
-  # check for ICE first), but we must link in the order -lSM -lICE or
-  # we get undefined symbols.  So assume we have SM if we have ICE.
-  # These have to be linked with before -lX11, unlike the other
-  # libraries we check for below, so use a different variable.
-  # John Interrante, Karl Berry
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IceConnectionNumber in -lICE" >&5
-$as_echo_n "checking for IceConnectionNumber in -lICE... " >&6; }
-if ${ac_cv_lib_ICE_IceConnectionNumber+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lICE $X_EXTRA_LIBS $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char IceConnectionNumber ();
-int
-main ()
-{
-return IceConnectionNumber ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_ICE_IceConnectionNumber=yes
-else
-  ac_cv_lib_ICE_IceConnectionNumber=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
-$as_echo "$ac_cv_lib_ICE_IceConnectionNumber" >&6; }
-if test "x$ac_cv_lib_ICE_IceConnectionNumber" = xyes; then :
-  X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
-fi
-
-  LDFLAGS=$ac_save_LDFLAGS
-
-fi
-
-ac_header_dirent=no
-for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
-  as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5
-$as_echo_n "checking for $ac_hdr that defines DIR... " >&6; }
-if eval \${$as_ac_Header+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <sys/types.h>
-#include <$ac_hdr>
-
-int
-main ()
-{
-if ((DIR *) 0)
-return 0;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  eval "$as_ac_Header=yes"
-else
-  eval "$as_ac_Header=no"
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-eval ac_res=\$$as_ac_Header
-	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
-_ACEOF
-
-ac_header_dirent=$ac_hdr; break
-fi
-
-done
-# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
-if test $ac_header_dirent = dirent.h; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5
-$as_echo_n "checking for library containing opendir... " >&6; }
-if ${ac_cv_search_opendir+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_func_search_save_LIBS=$LIBS
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char opendir ();
-int
-main ()
-{
-return opendir ();
-  ;
-  return 0;
-}
-_ACEOF
-for ac_lib in '' dir; do
-  if test -z "$ac_lib"; then
-    ac_res="none required"
-  else
-    ac_res=-l$ac_lib
-    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
-  fi
-  if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_search_opendir=$ac_res
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext
-  if ${ac_cv_search_opendir+:} false; then :
-  break
-fi
-done
-if ${ac_cv_search_opendir+:} false; then :
-
-else
-  ac_cv_search_opendir=no
-fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5
-$as_echo "$ac_cv_search_opendir" >&6; }
-ac_res=$ac_cv_search_opendir
-if test "$ac_res" != no; then :
-  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
-
-fi
-
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5
-$as_echo_n "checking for library containing opendir... " >&6; }
-if ${ac_cv_search_opendir+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_func_search_save_LIBS=$LIBS
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char opendir ();
-int
-main ()
-{
-return opendir ();
-  ;
-  return 0;
-}
-_ACEOF
-for ac_lib in '' x; do
-  if test -z "$ac_lib"; then
-    ac_res="none required"
-  else
-    ac_res=-l$ac_lib
-    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
-  fi
-  if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_search_opendir=$ac_res
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext
-  if ${ac_cv_search_opendir+:} false; then :
-  break
-fi
-done
-if ${ac_cv_search_opendir+:} false; then :
-
-else
-  ac_cv_search_opendir=no
-fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5
-$as_echo "$ac_cv_search_opendir" >&6; }
-ac_res=$ac_cv_search_opendir
-if test "$ac_res" != no; then :
-  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
-
-fi
-
-fi
-
-
-ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-
-
-
-ac_fn_cxx_check_func "$LINENO" "gethostbyname" "ac_cv_func_gethostbyname"
-if test "x$ac_cv_func_gethostbyname" = xyes; then :
-
-fi
-
-if test $ac_cv_func_gethostbyname = no; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lbsd" >&5
-$as_echo_n "checking for gethostbyname in -lbsd... " >&6; }
-if ${ac_cv_lib_bsd_gethostbyname+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lbsd  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char gethostbyname ();
-int
-main ()
-{
-return gethostbyname ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_link "$LINENO"; then :
-  ac_cv_lib_bsd_gethostbyname=yes
-else
-  ac_cv_lib_bsd_gethostbyname=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bsd_gethostbyname" >&5
-$as_echo "$ac_cv_lib_bsd_gethostbyname" >&6; }
-if test "x$ac_cv_lib_bsd_gethostbyname" = xyes; then :
-  X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
-fi
-
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking select() and fd_set in sys/select.h and sys/bsdtypes.h" >&5
-$as_echo_n "checking select() and fd_set in sys/select.h and sys/bsdtypes.h... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <stdlib.h>
-#include <stddef.h>
-#include <unistd.h>
-#include <sys/types.h>
-int
-main ()
-{
-fd_set fds;
-select(0, NULL, NULL, NULL, NULL);
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
-  xpdf_ok=yes
-else
-  xpdf_ok=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-if test $xpdf_ok = yes; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: not needed" >&5
-$as_echo "not needed" >&6; }
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <stdlib.h>
-#include <stddef.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/select.h>
-int
-main ()
-{
-fd_set fds;
-select(0, NULL, NULL, NULL, NULL);
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
-  xpdf_ok=yes
-else
-  xpdf_ok=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-  if test $xpdf_ok = yes; then
-    $as_echo "#define HAVE_SYS_SELECT_H 1" >>confdefs.h
-
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: need sys/select.h" >&5
-$as_echo "need sys/select.h" >&6; }
-  else
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <stdlib.h>
-#include <stddef.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/bsdtypes.h>
-int
-main ()
-{
-fd_set fds;
-select(0, NULL, NULL, NULL, NULL);
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
-  xpdf_ok=yes
-else
-  xpdf_ok=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-    if test $xpdf_ok = yes; then
-      $as_echo "#define HAVE_SYS_BSDTYPES_H 1" >>confdefs.h
-
-      { $as_echo "$as_me:${as_lineno-$LINENO}: result: need sys/bsdtypes.h" >&5
-$as_echo "need sys/bsdtypes.h" >&6; }
-    else
-      { $as_echo "$as_me:${as_lineno-$LINENO}: result: problem" >&5
-$as_echo "problem" >&6; }
-    fi
-  fi
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking FD_ZERO and strings.h or bstring.h" >&5
-$as_echo_n "checking FD_ZERO and strings.h or bstring.h... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <stdlib.h>
-#include <sys/types.h>
-#ifdef HAVE_SYS_SELECT_H
-#include <sys/select.h>
-#endif
-int
-main ()
-{
-fd_set fds; FD_ZERO(&fds);
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
-  xpdf_ok=yes
-else
-  xpdf_ok=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-if test $xpdf_ok = yes; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: not needed" >&5
-$as_echo "not needed" >&6; }
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <stdlib.h>
-#include <sys/types.h>
-#include <strings.h>
-#ifdef HAVE_SYS_SELECT_H
-#include <sys/select.h>
-#endif
-int
-main ()
-{
-fd_set fds; FD_ZERO(&fds);
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
-  xpdf_ok=yes
-else
-  xpdf_ok=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-  if test $xpdf_ok = yes; then
-    $as_echo "#define HAVE_STRINGS_H 1" >>confdefs.h
-
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: need strings.h" >&5
-$as_echo "need strings.h" >&6; }
-  else
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <stdlib.h>
-#include <sys/types.h>
-#include <bstring.h>
-#ifdef HAVE_SYS_SELECT_H
-#include <sys/select.h>
-#endif
-int
-main ()
-{
-fd_set fds; FD_ZERO(&fds);
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
-  xpdf_ok=yes
-else
-  xpdf_ok=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-    if test $xpdf_ok = yes; then
-      $as_echo "#define HAVE_BSTRING_H 1" >>confdefs.h
-
-      { $as_echo "$as_me:${as_lineno-$LINENO}: result: need bstring.h" >&5
-$as_echo "need bstring.h" >&6; }
-    else
-      { $as_echo "$as_me:${as_lineno-$LINENO}: result: problem" >&5
-$as_echo "problem" >&6; }
-    fi
-  fi
-fi
-
-for ac_func in rewinddir
-do :
-  ac_fn_cxx_check_func "$LINENO" "rewinddir" "ac_cv_func_rewinddir"
-if test "x$ac_cv_func_rewinddir" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_REWINDDIR 1
-_ACEOF
-
-fi
-done
-
-if test $ac_cv_func_rewinddir = no; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for rewinddir in -lcposix" >&5
-$as_echo_n "checking for rewinddir in -lcposix... " >&6; }
-if ${ac_cv_lib_cposix_rewinddir+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lcposix  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char rewinddir ();
-int
-main ()
-{
-return rewinddir ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_link "$LINENO"; then :
-  ac_cv_lib_cposix_rewinddir=yes
-else
-  ac_cv_lib_cposix_rewinddir=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cposix_rewinddir" >&5
-$as_echo "$ac_cv_lib_cposix_rewinddir" >&6; }
-if test "x$ac_cv_lib_cposix_rewinddir" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBCPOSIX 1
-_ACEOF
-
-  LIBS="-lcposix $LIBS"
-
-fi
-
-fi
-
-for ac_func in popen
-do :
-  ac_fn_cxx_check_func "$LINENO" "popen" "ac_cv_func_popen"
-if test "x$ac_cv_func_popen" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_POPEN 1
-_ACEOF
-
-fi
-done
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for mkstemp" >&5
-$as_echo_n "checking for mkstemp... " >&6; }
-if ${xpdf_cv_func_mkstemp+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <stdlib.h>
-#include <unistd.h>
-int
-main ()
-{
-mkstemp("foo");
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_link "$LINENO"; then :
-  xpdf_cv_func_mkstemp=yes
-else
-  xpdf_cv_func_mkstemp=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xpdf_cv_func_mkstemp" >&5
-$as_echo "$xpdf_cv_func_mkstemp" >&6; }
-if test "$xpdf_cv_func_mkstemp" = yes; then
-  $as_echo "#define HAVE_MKSTEMP 1" >>confdefs.h
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for mkstemps" >&5
-$as_echo_n "checking for mkstemps... " >&6; }
-if ${xpdf_cv_func_mkstemps+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <stdlib.h>
-#include <unistd.h>
-int
-main ()
-{
-mkstemps("foo", 0);
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_link "$LINENO"; then :
-  xpdf_cv_func_mkstemps=yes
-else
-  xpdf_cv_func_mkstemps=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xpdf_cv_func_mkstemps" >&5
-$as_echo "$xpdf_cv_func_mkstemps" >&6; }
-if test "$xpdf_cv_func_mkstemps" = yes; then
-  $as_echo "#define HAVE_MKSTEMPS 1" >>confdefs.h
-
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether select takes fd_set arguments" >&5
-$as_echo_n "checking whether select takes fd_set arguments... " >&6; }
-if ${xpdf_cv_func_select_arg+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <sys/types.h>
-#include <sys/time.h>
-#include <unistd.h>
-#ifdef HAVE_SYS_SELECT_H
-#include <sys/select.h>
-#endif
-int
-main ()
-{
-fd_set fds;
-select(1, &fds, &fds, &fds, 0);
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
-  xpdf_cv_func_select_arg=yes
-else
-  xpdf_cv_func_select_arg=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xpdf_cv_func_select_arg" >&5
-$as_echo "$xpdf_cv_func_select_arg" >&6; }
-if test "$xpdf_cv_func_select_arg" != yes; then
-  $as_echo "#define SELECT_TAKES_INT 1" >>confdefs.h
-
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for std::sort" >&5
-$as_echo_n "checking for std::sort... " >&6; }
-if ${xpdf_cv_func_std_sort+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <algorithm>
-struct functor {
-  bool operator()(const int &i0, const int &i1) { return i0 < i1; }
-};
-int
-main ()
-{
-int a[100];
-std::sort(a, a+100, functor());
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
-  xpdf_cv_func_std_sort=yes
-else
-  xpdf_cv_func_std_sort=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xpdf_cv_func_std_sort" >&5
-$as_echo "$xpdf_cv_func_std_sort" >&6; }
-if test "$xpdf_cv_func_std_sort" = yes; then
-  $as_echo "#define HAVE_STD_SORT 1" >>confdefs.h
-
-fi
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-# Check whether --enable-largefile was given.
-if test "${enable_largefile+set}" = set; then :
-  enableval=$enable_largefile;
-fi
-
-if test "$enable_largefile" != no; then
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5
-$as_echo_n "checking for special C compiler options needed for large files... " >&6; }
-if ${ac_cv_sys_largefile_CC+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_cv_sys_largefile_CC=no
-     if test "$GCC" != yes; then
-       ac_save_CC=$CC
-       while :; do
-	 # IRIX 6.2 and later do not support large files by default,
-	 # so use the C compiler's -n32 option if that helps.
-	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <sys/types.h>
- /* Check that off_t can represent 2**63 - 1 correctly.
-    We can't simply define LARGE_OFF_T to be 9223372036854775807,
-    since some C++ compilers masquerading as C compilers
-    incorrectly reject 9223372036854775807.  */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
-  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
-		       && LARGE_OFF_T % 2147483647 == 1)
-		      ? 1 : -1];
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-	 if ac_fn_c_try_compile "$LINENO"; then :
-  break
-fi
-rm -f core conftest.err conftest.$ac_objext
-	 CC="$CC -n32"
-	 if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_sys_largefile_CC=' -n32'; break
-fi
-rm -f core conftest.err conftest.$ac_objext
-	 break
-       done
-       CC=$ac_save_CC
-       rm -f conftest.$ac_ext
-    fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5
-$as_echo "$ac_cv_sys_largefile_CC" >&6; }
-  if test "$ac_cv_sys_largefile_CC" != no; then
-    CC=$CC$ac_cv_sys_largefile_CC
-  fi
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5
-$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; }
-if ${ac_cv_sys_file_offset_bits+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  while :; do
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <sys/types.h>
- /* Check that off_t can represent 2**63 - 1 correctly.
-    We can't simply define LARGE_OFF_T to be 9223372036854775807,
-    since some C++ compilers masquerading as C compilers
-    incorrectly reject 9223372036854775807.  */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
-  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
-		       && LARGE_OFF_T % 2147483647 == 1)
-		      ? 1 : -1];
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_sys_file_offset_bits=no; break
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#define _FILE_OFFSET_BITS 64
-#include <sys/types.h>
- /* Check that off_t can represent 2**63 - 1 correctly.
-    We can't simply define LARGE_OFF_T to be 9223372036854775807,
-    since some C++ compilers masquerading as C compilers
-    incorrectly reject 9223372036854775807.  */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
-  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
-		       && LARGE_OFF_T % 2147483647 == 1)
-		      ? 1 : -1];
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_sys_file_offset_bits=64; break
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-  ac_cv_sys_file_offset_bits=unknown
-  break
-done
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5
-$as_echo "$ac_cv_sys_file_offset_bits" >&6; }
-case $ac_cv_sys_file_offset_bits in #(
-  no | unknown) ;;
-  *)
-cat >>confdefs.h <<_ACEOF
-#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
-_ACEOF
-;;
-esac
-rm -rf conftest*
-  if test $ac_cv_sys_file_offset_bits = unknown; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5
-$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; }
-if ${ac_cv_sys_large_files+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  while :; do
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <sys/types.h>
- /* Check that off_t can represent 2**63 - 1 correctly.
-    We can't simply define LARGE_OFF_T to be 9223372036854775807,
-    since some C++ compilers masquerading as C compilers
-    incorrectly reject 9223372036854775807.  */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
-  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
-		       && LARGE_OFF_T % 2147483647 == 1)
-		      ? 1 : -1];
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_sys_large_files=no; break
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#define _LARGE_FILES 1
-#include <sys/types.h>
- /* Check that off_t can represent 2**63 - 1 correctly.
-    We can't simply define LARGE_OFF_T to be 9223372036854775807,
-    since some C++ compilers masquerading as C compilers
-    incorrectly reject 9223372036854775807.  */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
-  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
-		       && LARGE_OFF_T % 2147483647 == 1)
-		      ? 1 : -1];
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_sys_large_files=1; break
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-  ac_cv_sys_large_files=unknown
-  break
-done
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5
-$as_echo "$ac_cv_sys_large_files" >&6; }
-case $ac_cv_sys_large_files in #(
-  no | unknown) ;;
-  *)
-cat >>confdefs.h <<_ACEOF
-#define _LARGE_FILES $ac_cv_sys_large_files
-_ACEOF
-;;
-esac
-rm -rf conftest*
-  fi
-
-
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGEFILE_SOURCE value needed for large files" >&5
-$as_echo_n "checking for _LARGEFILE_SOURCE value needed for large files... " >&6; }
-if ${ac_cv_sys_largefile_source+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  while :; do
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <sys/types.h> /* for off_t */
-     #include <stdio.h>
-int
-main ()
-{
-int (*fp) (FILE *, off_t, int) = fseeko;
-     return fseeko (stdin, 0, 0) && fp (stdin, 0, 0);
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_sys_largefile_source=no; break
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#define _LARGEFILE_SOURCE 1
-#include <sys/types.h> /* for off_t */
-     #include <stdio.h>
-int
-main ()
-{
-int (*fp) (FILE *, off_t, int) = fseeko;
-     return fseeko (stdin, 0, 0) && fp (stdin, 0, 0);
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_sys_largefile_source=1; break
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-  ac_cv_sys_largefile_source=unknown
-  break
-done
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_source" >&5
-$as_echo "$ac_cv_sys_largefile_source" >&6; }
-case $ac_cv_sys_largefile_source in #(
-  no | unknown) ;;
-  *)
-cat >>confdefs.h <<_ACEOF
-#define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source
-_ACEOF
-;;
-esac
-rm -rf conftest*
-
-# We used to try defining _XOPEN_SOURCE=500 too, to work around a bug
-# in glibc 2.1.3, but that breaks too many other things.
-# If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
-if test $ac_cv_sys_largefile_source != unknown; then
-
-$as_echo "#define HAVE_FSEEKO 1" >>confdefs.h
-
-fi
-
-for ac_func in fseek64
-do :
-  ac_fn_c_check_func "$LINENO" "fseek64" "ac_cv_func_fseek64"
-if test "x$ac_cv_func_fseek64" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_FSEEK64 1
-_ACEOF
- xpdf_cv_func_fseek64=yes
-else
-  xpdf_cv_func_fseek64=no
-fi
-done
-
-for ac_func in ftell64
-do :
-  ac_fn_c_check_func "$LINENO" "ftell64" "ac_cv_func_ftell64"
-if test "x$ac_cv_func_ftell64" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_FTELL64 1
-_ACEOF
- xpdf_cv_func_ftell64=yes
-else
-  xpdf_cv_func_ftell64=no
-fi
-done
-
-if test "$xpdf_cv_func_fseek64" = yes -a "$xpdf_cv_func_ftell64" = yes; then
-  $as_echo "#define HAVE_FSEEK64 1" >>confdefs.h
-
-fi
-
-if test -z "$no_x"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
-$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
-if ${ac_cv_path_GREP+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -z "$GREP"; then
-  ac_path_GREP_found=false
-  # Loop through the user's path and test for each of PROGNAME-LIST
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_prog in grep ggrep; do
-    for ac_exec_ext in '' $ac_executable_extensions; do
-      ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
-      as_fn_executable_p "$ac_path_GREP" || continue
-# Check for GNU ac_path_GREP and select it if it is found.
-  # Check for GNU $ac_path_GREP
-case `"$ac_path_GREP" --version 2>&1` in
-*GNU*)
-  ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
-*)
-  ac_count=0
-  $as_echo_n 0123456789 >"conftest.in"
-  while :
-  do
-    cat "conftest.in" "conftest.in" >"conftest.tmp"
-    mv "conftest.tmp" "conftest.in"
-    cp "conftest.in" "conftest.nl"
-    $as_echo 'GREP' >> "conftest.nl"
-    "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
-    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
-    as_fn_arith $ac_count + 1 && ac_count=$as_val
-    if test $ac_count -gt ${ac_path_GREP_max-0}; then
-      # Best one so far, save it but keep looking for a better one
-      ac_cv_path_GREP="$ac_path_GREP"
-      ac_path_GREP_max=$ac_count
-    fi
-    # 10*(2^10) chars as input seems more than enough
-    test $ac_count -gt 10 && break
-  done
-  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
-esac
-
-      $ac_path_GREP_found && break 3
-    done
-  done
-  done
-IFS=$as_save_IFS
-  if test -z "$ac_cv_path_GREP"; then
-    as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
-  fi
-else
-  ac_cv_path_GREP=$GREP
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
-$as_echo "$ac_cv_path_GREP" >&6; }
- GREP="$ac_cv_path_GREP"
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
-$as_echo_n "checking for egrep... " >&6; }
-if ${ac_cv_path_EGREP+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
-   then ac_cv_path_EGREP="$GREP -E"
-   else
-     if test -z "$EGREP"; then
-  ac_path_EGREP_found=false
-  # Loop through the user's path and test for each of PROGNAME-LIST
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_prog in egrep; do
-    for ac_exec_ext in '' $ac_executable_extensions; do
-      ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
-      as_fn_executable_p "$ac_path_EGREP" || continue
-# Check for GNU ac_path_EGREP and select it if it is found.
-  # Check for GNU $ac_path_EGREP
-case `"$ac_path_EGREP" --version 2>&1` in
-*GNU*)
-  ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
-*)
-  ac_count=0
-  $as_echo_n 0123456789 >"conftest.in"
-  while :
-  do
-    cat "conftest.in" "conftest.in" >"conftest.tmp"
-    mv "conftest.tmp" "conftest.in"
-    cp "conftest.in" "conftest.nl"
-    $as_echo 'EGREP' >> "conftest.nl"
-    "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
-    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
-    as_fn_arith $ac_count + 1 && ac_count=$as_val
-    if test $ac_count -gt ${ac_path_EGREP_max-0}; then
-      # Best one so far, save it but keep looking for a better one
-      ac_cv_path_EGREP="$ac_path_EGREP"
-      ac_path_EGREP_max=$ac_count
-    fi
-    # 10*(2^10) chars as input seems more than enough
-    test $ac_count -gt 10 && break
-  done
-  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
-esac
-
-      $ac_path_EGREP_found && break 3
-    done
-  done
-  done
-IFS=$as_save_IFS
-  if test -z "$ac_cv_path_EGREP"; then
-    as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
-  fi
-else
-  ac_cv_path_EGREP=$EGREP
-fi
-
-   fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
-$as_echo "$ac_cv_path_EGREP" >&6; }
- EGREP="$ac_cv_path_EGREP"
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
-$as_echo_n "checking for ANSI C header files... " >&6; }
-if ${ac_cv_header_stdc+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <float.h>
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_header_stdc=yes
-else
-  ac_cv_header_stdc=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-if test $ac_cv_header_stdc = yes; then
-  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <string.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "memchr" >/dev/null 2>&1; then :
-
-else
-  ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
-  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <stdlib.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "free" >/dev/null 2>&1; then :
-
-else
-  ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
-  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
-  if test "$cross_compiling" = yes; then :
-  :
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <ctype.h>
-#include <stdlib.h>
-#if ((' ' & 0x0FF) == 0x020)
-# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
-# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
-#else
-# define ISLOWER(c) \
-		   (('a' <= (c) && (c) <= 'i') \
-		     || ('j' <= (c) && (c) <= 'r') \
-		     || ('s' <= (c) && (c) <= 'z'))
-# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
-#endif
-
-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
-int
-main ()
-{
-  int i;
-  for (i = 0; i < 256; i++)
-    if (XOR (islower (i), ISLOWER (i))
-	|| toupper (i) != TOUPPER (i))
-      return 2;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-
-else
-  ac_cv_header_stdc=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
-$as_echo "$ac_cv_header_stdc" >&6; }
-if test $ac_cv_header_stdc = yes; then
-
-$as_echo "#define STDC_HEADERS 1" >>confdefs.h
-
-fi
-
-# On IRIX 5.3, sys/types and inttypes.h are conflicting.
-for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
-		  inttypes.h stdint.h unistd.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
-"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-# Check whether --with-Xpm-library was given.
-if test "${with_Xpm_library+set}" = set; then :
-  withval=$with_Xpm_library; smr_cv_with_Xpm_library=$withval
-fi
-
-
-      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use Xpm library" >&5
-$as_echo_n "checking whether to use Xpm library... " >&6; }
-if ${smr_cv_with_Xpm_library+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  smr_cv_with_Xpm_library=maybe
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $smr_cv_with_Xpm_library" >&5
-$as_echo "$smr_cv_with_Xpm_library" >&6; }
-
-
-  case x"$smr_cv_with_Xpm_library" in
-      xyes | xmaybe)
-          Xpm_LIBS="-lXpm"
-          with_Xpm=$smr_cv_with_Xpm_library
-          ;;
-      xno)
-          Xpm_LIBS=
-          with_Xpm=no
-          ;;
-      *)
-          if test -f "$smr_cv_with_Xpm_library"; then
-            Xpm_LIBS=$smr_cv_with_Xpm_library
-          elif test -d "$smr_cv_with_Xpm_library"; then
-            Xpm_LIBS="-L$smr_cv_with_Xpm_library -lXpm"
-          else
-            as_fn_error $? "argument must be boolean, file, or directory" "$LINENO" 5
-          fi
-          with_Xpm=yes
-          ;;
-  esac
-
-
-
-
-
-
-
-  if test ! x"$with_Xpm" = xno; then
-
-    # If we got this far, then the user didn't explicitly ask not to use
-    # the library.
-
-
-
-
-
-
-
-
-# Check whether --with-Xpm-includes was given.
-if test "${with_Xpm_includes+set}" = set; then :
-  withval=$with_Xpm_includes; smr_cv_with_Xpm_includes=$withval
-fi
-
-
-      { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the Xpm header files" >&5
-$as_echo_n "checking where to find the Xpm header files... " >&6; }
-if ${smr_cv_with_Xpm_includes+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  smr_cv_with_Xpm_includes=
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $smr_cv_with_Xpm_includes" >&5
-$as_echo "$smr_cv_with_Xpm_includes" >&6; }
-
-  if test ! x"$smr_cv_with_Xpm_includes" = x; then
-    if test -d "$smr_cv_with_Xpm_includes"; then
-      Xpm_CFLAGS="-I$smr_cv_with_Xpm_includes"
-    else
-      as_fn_error $? "argument must be a directory" "$LINENO" 5
-    fi
-  else
-    Xpm_CFLAGS=
-  fi
-
-        smr_test_CPPFLAGS="${CPPFLAGS+set}"
-  smr_save_CPPFLAGS="$CPPFLAGS"
-  CPPFLAGS="$CPPFLAGS $Xpm_CFLAGS $X_CFLAGS"
-
-      for ac_header in X11/xpm.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "X11/xpm.h" "ac_cv_header_X11_xpm_h" "$ac_includes_default"
-if test "x$ac_cv_header_X11_xpm_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_X11_XPM_H 1
-_ACEOF
- smr_have_Xpm_header=yes
-else
-  smr_have_Xpm_header=no
-fi
-
-done
-
-
-  if test x"$smr_test_CPPFLAGS" = xset; then
-    CPPFLAGS=$smr_save_CPPFLAGS
-  else
-    unset CPPFLAGS
-  fi
-
-
-
-
-
-
-
-    # We need only look for the library if the header has been found
-    # (or no header is needed).
-    if test $smr_have_Xpm_header != no; then
-
-       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XpmCreatePixmapFromData in -lXpm" >&5
-$as_echo_n "checking for XpmCreatePixmapFromData in -lXpm... " >&6; }
-if ${ac_cv_lib_Xpm_XpmCreatePixmapFromData+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lXpm $Xpm_CFLAGS $X_CFLAGS $Xpm_LIBS $X_LIBS $X_PRE_LIBS $X_EXTRA_LIBS -lX11 $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char XpmCreatePixmapFromData ();
-int
-main ()
-{
-return XpmCreatePixmapFromData ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_Xpm_XpmCreatePixmapFromData=yes
-else
-  ac_cv_lib_Xpm_XpmCreatePixmapFromData=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xpm_XpmCreatePixmapFromData" >&5
-$as_echo "$ac_cv_lib_Xpm_XpmCreatePixmapFromData" >&6; }
-if test "x$ac_cv_lib_Xpm_XpmCreatePixmapFromData" = xyes; then :
-  smr_have_Xpm_library=yes
-else
-  smr_have_Xpm_library=no
-fi
-
-    fi
-
-    if test x"$smr_have_Xpm_library" = xyes; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: result: using Xpm library" >&5
-$as_echo "using Xpm library" >&6; }
-    else
-      Xpm_LIBS=
-      Xpm_CFLAGS=
-
-      if test x"$with_Xpm" = xmaybe; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: not using Xpm library" >&5
-$as_echo "not using Xpm library" >&6; }
-      else
-        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: requested Xpm library not found!" >&5
-$as_echo "$as_me: WARNING: requested Xpm library not found!" >&2;}
-      fi
-    fi
-  fi
-
-
-
-
-
-
-
-
-
-
-
-
-
-fi
-
-if test -z "$no_x"; then
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-# Check whether --with-Xext-library was given.
-if test "${with_Xext_library+set}" = set; then :
-  withval=$with_Xext_library; smr_cv_with_Xext_library=$withval
-fi
-
-
-      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use Xext library" >&5
-$as_echo_n "checking whether to use Xext library... " >&6; }
-if ${smr_cv_with_Xext_library+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  smr_cv_with_Xext_library=maybe
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $smr_cv_with_Xext_library" >&5
-$as_echo "$smr_cv_with_Xext_library" >&6; }
-
-
-  case x"$smr_cv_with_Xext_library" in
-      xyes | xmaybe)
-          Xext_LIBS="-lXext"
-          with_Xext=$smr_cv_with_Xext_library
-          ;;
-      xno)
-          Xext_LIBS=
-          with_Xext=no
-          ;;
-      *)
-          if test -f "$smr_cv_with_Xext_library"; then
-            Xext_LIBS=$smr_cv_with_Xext_library
-          elif test -d "$smr_cv_with_Xext_library"; then
-            Xext_LIBS="-L$smr_cv_with_Xext_library -lXext"
-          else
-            as_fn_error $? "argument must be boolean, file, or directory" "$LINENO" 5
-          fi
-          with_Xext=yes
-          ;;
-  esac
-
-
-
-
-
-
-
-  if test ! x"$with_Xext" = xno; then
-
-    # If we got this far, then the user didn't explicitly ask not to use
-    # the library.
-
-
-
-
-
-
-
-
-# Check whether --with-Xext-includes was given.
-if test "${with_Xext_includes+set}" = set; then :
-  withval=$with_Xext_includes; smr_cv_with_Xext_includes=$withval
-fi
-
-
-      { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the Xext header files" >&5
-$as_echo_n "checking where to find the Xext header files... " >&6; }
-if ${smr_cv_with_Xext_includes+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  smr_cv_with_Xext_includes=
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $smr_cv_with_Xext_includes" >&5
-$as_echo "$smr_cv_with_Xext_includes" >&6; }
-
-  if test ! x"$smr_cv_with_Xext_includes" = x; then
-    if test -d "$smr_cv_with_Xext_includes"; then
-      Xext_CFLAGS="-I$smr_cv_with_Xext_includes"
-    else
-      as_fn_error $? "argument must be a directory" "$LINENO" 5
-    fi
-  else
-    Xext_CFLAGS=
-  fi
-
-        smr_test_CPPFLAGS="${CPPFLAGS+set}"
-  smr_save_CPPFLAGS="$CPPFLAGS"
-  CPPFLAGS="$CPPFLAGS $Xext_CFLAGS $X_CFLAGS"
-
-      for ac_header in X11/Xlib.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "X11/Xlib.h" "ac_cv_header_X11_Xlib_h" "$ac_includes_default"
-if test "x$ac_cv_header_X11_Xlib_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_X11_XLIB_H 1
-_ACEOF
- smr_have_Xext_header=yes
-else
-  smr_have_Xext_header=no
-fi
-
-done
-
-
-  if test x"$smr_test_CPPFLAGS" = xset; then
-    CPPFLAGS=$smr_save_CPPFLAGS
-  else
-    unset CPPFLAGS
-  fi
-
-
-
-
-
-
-
-    # We need only look for the library if the header has been found
-    # (or no header is needed).
-    if test $smr_have_Xext_header != no; then
-
-       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XextAddDisplay in -lXext" >&5
-$as_echo_n "checking for XextAddDisplay in -lXext... " >&6; }
-if ${ac_cv_lib_Xext_XextAddDisplay+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lXext $Xext_CFLAGS $X_CFLAGS $Xext_LIBS $X_LIBS $X_PRE_LIBS $X_EXTRA_LIBS -lX11 $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char XextAddDisplay ();
-int
-main ()
-{
-return XextAddDisplay ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_Xext_XextAddDisplay=yes
-else
-  ac_cv_lib_Xext_XextAddDisplay=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xext_XextAddDisplay" >&5
-$as_echo "$ac_cv_lib_Xext_XextAddDisplay" >&6; }
-if test "x$ac_cv_lib_Xext_XextAddDisplay" = xyes; then :
-  smr_have_Xext_library=yes
-else
-  smr_have_Xext_library=no
-fi
-
-    fi
-
-    if test x"$smr_have_Xext_library" = xyes; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: result: using Xext library" >&5
-$as_echo "using Xext library" >&6; }
-    else
-      Xext_LIBS=
-      Xext_CFLAGS=
-
-      if test x"$with_Xext" = xmaybe; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: not using Xext library" >&5
-$as_echo "not using Xext library" >&6; }
-      else
-        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: requested Xext library not found!" >&5
-$as_echo "$as_me: WARNING: requested Xext library not found!" >&2;}
-      fi
-    fi
-  fi
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-# Check whether --with-Xp-library was given.
-if test "${with_Xp_library+set}" = set; then :
-  withval=$with_Xp_library; smr_cv_with_Xp_library=$withval
-fi
-
-
-      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use Xp library" >&5
-$as_echo_n "checking whether to use Xp library... " >&6; }
-if ${smr_cv_with_Xp_library+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  smr_cv_with_Xp_library=maybe
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $smr_cv_with_Xp_library" >&5
-$as_echo "$smr_cv_with_Xp_library" >&6; }
-
-
-  case x"$smr_cv_with_Xp_library" in
-      xyes | xmaybe)
-          Xp_LIBS="-lXp"
-          with_Xp=$smr_cv_with_Xp_library
-          ;;
-      xno)
-          Xp_LIBS=
-          with_Xp=no
-          ;;
-      *)
-          if test -f "$smr_cv_with_Xp_library"; then
-            Xp_LIBS=$smr_cv_with_Xp_library
-          elif test -d "$smr_cv_with_Xp_library"; then
-            Xp_LIBS="-L$smr_cv_with_Xp_library -lXp"
-          else
-            as_fn_error $? "argument must be boolean, file, or directory" "$LINENO" 5
-          fi
-          with_Xp=yes
-          ;;
-  esac
-
-
-
-
-
-
-
-  if test ! x"$with_Xp" = xno; then
-
-    # If we got this far, then the user didn't explicitly ask not to use
-    # the library.
-
-
-
-
-
-
-
-
-# Check whether --with-Xp-includes was given.
-if test "${with_Xp_includes+set}" = set; then :
-  withval=$with_Xp_includes; smr_cv_with_Xp_includes=$withval
-fi
-
-
-      { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the Xp header files" >&5
-$as_echo_n "checking where to find the Xp header files... " >&6; }
-if ${smr_cv_with_Xp_includes+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  smr_cv_with_Xp_includes=
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $smr_cv_with_Xp_includes" >&5
-$as_echo "$smr_cv_with_Xp_includes" >&6; }
-
-  if test ! x"$smr_cv_with_Xp_includes" = x; then
-    if test -d "$smr_cv_with_Xp_includes"; then
-      Xp_CFLAGS="-I$smr_cv_with_Xp_includes"
-    else
-      as_fn_error $? "argument must be a directory" "$LINENO" 5
-    fi
-  else
-    Xp_CFLAGS=
-  fi
-
-        smr_test_CPPFLAGS="${CPPFLAGS+set}"
-  smr_save_CPPFLAGS="$CPPFLAGS"
-  CPPFLAGS="$CPPFLAGS $Xp_CFLAGS $X_CFLAGS"
-
-      for ac_header in X11/extensions/Print.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "X11/extensions/Print.h" "ac_cv_header_X11_extensions_Print_h" "$ac_includes_default"
-if test "x$ac_cv_header_X11_extensions_Print_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_X11_EXTENSIONS_PRINT_H 1
-_ACEOF
- smr_have_Xp_header=yes
-else
-  smr_have_Xp_header=no
-fi
-
-done
-
-
-  if test x"$smr_test_CPPFLAGS" = xset; then
-    CPPFLAGS=$smr_save_CPPFLAGS
-  else
-    unset CPPFLAGS
-  fi
-
-
-
-
-
-
-
-    # We need only look for the library if the header has been found
-    # (or no header is needed).
-    if test $smr_have_Xp_header != no; then
-
-       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XpStartPage in -lXp" >&5
-$as_echo_n "checking for XpStartPage in -lXp... " >&6; }
-if ${ac_cv_lib_Xp_XpStartPage+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lXp $Xp_CFLAGS $X_CFLAGS $Xp_LIBS $X_LIBS $X_PRE_LIBS $Xext_LIBS $X_EXTRA_LIBS -lX11 $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char XpStartPage ();
-int
-main ()
-{
-return XpStartPage ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_Xp_XpStartPage=yes
-else
-  ac_cv_lib_Xp_XpStartPage=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xp_XpStartPage" >&5
-$as_echo "$ac_cv_lib_Xp_XpStartPage" >&6; }
-if test "x$ac_cv_lib_Xp_XpStartPage" = xyes; then :
-  smr_have_Xp_library=yes
-else
-  smr_have_Xp_library=no
-fi
-
-    fi
-
-    if test x"$smr_have_Xp_library" = xyes; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: result: using Xp library" >&5
-$as_echo "using Xp library" >&6; }
-    else
-      Xp_LIBS=
-      Xp_CFLAGS=
-
-      if test x"$with_Xp" = xmaybe; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: not using Xp library" >&5
-$as_echo "not using Xp library" >&6; }
-      else
-        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: requested Xp library not found!" >&5
-$as_echo "$as_me: WARNING: requested Xp library not found!" >&2;}
-      fi
-    fi
-  fi
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-# Check whether --with-Xt-library was given.
-if test "${with_Xt_library+set}" = set; then :
-  withval=$with_Xt_library; smr_cv_with_Xt_library=$withval
-fi
-
-
-      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use Xt library" >&5
-$as_echo_n "checking whether to use Xt library... " >&6; }
-if ${smr_cv_with_Xt_library+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  smr_cv_with_Xt_library=maybe
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $smr_cv_with_Xt_library" >&5
-$as_echo "$smr_cv_with_Xt_library" >&6; }
-
-
-  case x"$smr_cv_with_Xt_library" in
-      xyes | xmaybe)
-          Xt_LIBS="-lXt"
-          with_Xt=$smr_cv_with_Xt_library
-          ;;
-      xno)
-          Xt_LIBS=
-          with_Xt=no
-          ;;
-      *)
-          if test -f "$smr_cv_with_Xt_library"; then
-            Xt_LIBS=$smr_cv_with_Xt_library
-          elif test -d "$smr_cv_with_Xt_library"; then
-            Xt_LIBS="-L$smr_cv_with_Xt_library -lXt"
-          else
-            as_fn_error $? "argument must be boolean, file, or directory" "$LINENO" 5
-          fi
-          with_Xt=yes
-          ;;
-  esac
-
-
-
-
-
-
-
-  if test ! x"$with_Xt" = xno; then
-
-    # If we got this far, then the user didn't explicitly ask not to use
-    # the library.
-
-
-
-
-
-
-
-
-# Check whether --with-Xt-includes was given.
-if test "${with_Xt_includes+set}" = set; then :
-  withval=$with_Xt_includes; smr_cv_with_Xt_includes=$withval
-fi
-
-
-      { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the Xt header files" >&5
-$as_echo_n "checking where to find the Xt header files... " >&6; }
-if ${smr_cv_with_Xt_includes+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  smr_cv_with_Xt_includes=
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $smr_cv_with_Xt_includes" >&5
-$as_echo "$smr_cv_with_Xt_includes" >&6; }
-
-  if test ! x"$smr_cv_with_Xt_includes" = x; then
-    if test -d "$smr_cv_with_Xt_includes"; then
-      Xt_CFLAGS="-I$smr_cv_with_Xt_includes"
-    else
-      as_fn_error $? "argument must be a directory" "$LINENO" 5
-    fi
-  else
-    Xt_CFLAGS=
-  fi
-
-        smr_test_CPPFLAGS="${CPPFLAGS+set}"
-  smr_save_CPPFLAGS="$CPPFLAGS"
-  CPPFLAGS="$CPPFLAGS $Xt_CFLAGS $X_CFLAGS"
-
-      for ac_header in X11/Intrinsic.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "X11/Intrinsic.h" "ac_cv_header_X11_Intrinsic_h" "$ac_includes_default"
-if test "x$ac_cv_header_X11_Intrinsic_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_X11_INTRINSIC_H 1
-_ACEOF
- smr_have_Xt_header=yes
-else
-  smr_have_Xt_header=no
-fi
-
-done
-
-
-  if test x"$smr_test_CPPFLAGS" = xset; then
-    CPPFLAGS=$smr_save_CPPFLAGS
-  else
-    unset CPPFLAGS
-  fi
-
-
-
-
-
-
-
-    # We need only look for the library if the header has been found
-    # (or no header is needed).
-    if test $smr_have_Xt_header != no; then
-
-       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XtAppInitialize in -lXt" >&5
-$as_echo_n "checking for XtAppInitialize in -lXt... " >&6; }
-if ${ac_cv_lib_Xt_XtAppInitialize+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lXt $Xt_CFLAGS $X_CFLAGS $Xt_LIBS $X_LIBS $X_PRE_LIBS $X_EXTRA_LIBS -lX11 $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char XtAppInitialize ();
-int
-main ()
-{
-return XtAppInitialize ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_Xt_XtAppInitialize=yes
-else
-  ac_cv_lib_Xt_XtAppInitialize=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xt_XtAppInitialize" >&5
-$as_echo "$ac_cv_lib_Xt_XtAppInitialize" >&6; }
-if test "x$ac_cv_lib_Xt_XtAppInitialize" = xyes; then :
-  smr_have_Xt_library=yes
-else
-  smr_have_Xt_library=no
-fi
-
-    fi
-
-    if test x"$smr_have_Xt_library" = xyes; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: result: using Xt library" >&5
-$as_echo "using Xt library" >&6; }
-    else
-      Xt_LIBS=
-      Xt_CFLAGS=
-
-      if test x"$with_Xt" = xmaybe; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: not using Xt library" >&5
-$as_echo "not using Xt library" >&6; }
-      else
-        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: requested Xt library not found!" >&5
-$as_echo "$as_me: WARNING: requested Xt library not found!" >&2;}
-      fi
-    fi
-  fi
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-# Check whether --with-Xm-library was given.
-if test "${with_Xm_library+set}" = set; then :
-  withval=$with_Xm_library; smr_cv_with_Xm_library=$withval
-fi
-
-
-      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use Xm library" >&5
-$as_echo_n "checking whether to use Xm library... " >&6; }
-if ${smr_cv_with_Xm_library+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  smr_cv_with_Xm_library=maybe
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $smr_cv_with_Xm_library" >&5
-$as_echo "$smr_cv_with_Xm_library" >&6; }
-
-
-  case x"$smr_cv_with_Xm_library" in
-      xyes | xmaybe)
-          Xm_LIBS="-lXm"
-          with_Xm=$smr_cv_with_Xm_library
-          ;;
-      xno)
-          Xm_LIBS=
-          with_Xm=no
-          ;;
-      *)
-          if test -f "$smr_cv_with_Xm_library"; then
-            Xm_LIBS=$smr_cv_with_Xm_library
-          elif test -d "$smr_cv_with_Xm_library"; then
-            Xm_LIBS="-L$smr_cv_with_Xm_library -lXm"
-          else
-            as_fn_error $? "argument must be boolean, file, or directory" "$LINENO" 5
-          fi
-          with_Xm=yes
-          ;;
-  esac
-
-
-
-
-
-
-
-  if test ! x"$with_Xm" = xno; then
-
-    # If we got this far, then the user didn't explicitly ask not to use
-    # the library.
-
-
-
-
-
-
-
-
-# Check whether --with-Xm-includes was given.
-if test "${with_Xm_includes+set}" = set; then :
-  withval=$with_Xm_includes; smr_cv_with_Xm_includes=$withval
-fi
-
-
-      { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the Xm header files" >&5
-$as_echo_n "checking where to find the Xm header files... " >&6; }
-if ${smr_cv_with_Xm_includes+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  smr_cv_with_Xm_includes=
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $smr_cv_with_Xm_includes" >&5
-$as_echo "$smr_cv_with_Xm_includes" >&6; }
-
-  if test ! x"$smr_cv_with_Xm_includes" = x; then
-    if test -d "$smr_cv_with_Xm_includes"; then
-      Xm_CFLAGS="-I$smr_cv_with_Xm_includes"
-    else
-      as_fn_error $? "argument must be a directory" "$LINENO" 5
-    fi
-  else
-    Xm_CFLAGS=
-  fi
-
-        smr_test_CPPFLAGS="${CPPFLAGS+set}"
-  smr_save_CPPFLAGS="$CPPFLAGS"
-  CPPFLAGS="$CPPFLAGS $Xm_CFLAGS $X_CFLAGS"
-
-      for ac_header in Xm/XmAll.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "Xm/XmAll.h" "ac_cv_header_Xm_XmAll_h" "$ac_includes_default"
-if test "x$ac_cv_header_Xm_XmAll_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_XM_XMALL_H 1
-_ACEOF
- smr_have_Xm_header=yes
-else
-  smr_have_Xm_header=no
-fi
-
-done
-
-
-  if test x"$smr_test_CPPFLAGS" = xset; then
-    CPPFLAGS=$smr_save_CPPFLAGS
-  else
-    unset CPPFLAGS
-  fi
-
-
-
-
-
-
-
-    # We need only look for the library if the header has been found
-    # (or no header is needed).
-    if test $smr_have_Xm_header != no; then
-
-       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XmCreateForm in -lXm" >&5
-$as_echo_n "checking for XmCreateForm in -lXm... " >&6; }
-if ${ac_cv_lib_Xm_XmCreateForm+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lXm $Xm_CFLAGS $X_CFLAGS $Xm_LIBS $Xt_LIBS $X_LIBS $X_PRE_LIBS $Xp_LIBS $Xext_LIBS $X_EXTRA_LIBS -lX11 $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char XmCreateForm ();
-int
-main ()
-{
-return XmCreateForm ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_Xm_XmCreateForm=yes
-else
-  ac_cv_lib_Xm_XmCreateForm=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xm_XmCreateForm" >&5
-$as_echo "$ac_cv_lib_Xm_XmCreateForm" >&6; }
-if test "x$ac_cv_lib_Xm_XmCreateForm" = xyes; then :
-  smr_have_Xm_library=yes
-else
-  smr_have_Xm_library=no
-fi
-
-    fi
-
-    if test x"$smr_have_Xm_library" = xyes; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: result: using Xm library" >&5
-$as_echo "using Xm library" >&6; }
-    else
-      Xm_LIBS=
-      Xm_CFLAGS=
-
-      if test x"$with_Xm" = xmaybe; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: not using Xm library" >&5
-$as_echo "not using Xm library" >&6; }
-      else
-        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: requested Xm library not found!" >&5
-$as_echo "$as_me: WARNING: requested Xm library not found!" >&2;}
-      fi
-    fi
-  fi
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-# Check whether --with-Sgm-library was given.
-if test "${with_Sgm_library+set}" = set; then :
-  withval=$with_Sgm_library; smr_cv_with_Sgm_library=$withval
-fi
-
-
-      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use Sgm library" >&5
-$as_echo_n "checking whether to use Sgm library... " >&6; }
-if ${smr_cv_with_Sgm_library+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  smr_cv_with_Sgm_library=maybe
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $smr_cv_with_Sgm_library" >&5
-$as_echo "$smr_cv_with_Sgm_library" >&6; }
-
-
-  case x"$smr_cv_with_Sgm_library" in
-      xyes | xmaybe)
-          Sgm_LIBS="-lSgm"
-          with_Sgm=$smr_cv_with_Sgm_library
-          ;;
-      xno)
-          Sgm_LIBS=
-          with_Sgm=no
-          ;;
-      *)
-          if test -f "$smr_cv_with_Sgm_library"; then
-            Sgm_LIBS=$smr_cv_with_Sgm_library
-          elif test -d "$smr_cv_with_Sgm_library"; then
-            Sgm_LIBS="-L$smr_cv_with_Sgm_library -lSgm"
-          else
-            as_fn_error $? "argument must be boolean, file, or directory" "$LINENO" 5
-          fi
-          with_Sgm=yes
-          ;;
-  esac
-
-
-
-
-
-
-
-  if test ! x"$with_Sgm" = xno; then
-
-    # If we got this far, then the user didn't explicitly ask not to use
-    # the library.
-
-
-
-
-
-
-
-
-# Check whether --with-Sgm-includes was given.
-if test "${with_Sgm_includes+set}" = set; then :
-  withval=$with_Sgm_includes; smr_cv_with_Sgm_includes=$withval
-fi
-
-
-      { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the Sgm header files" >&5
-$as_echo_n "checking where to find the Sgm header files... " >&6; }
-if ${smr_cv_with_Sgm_includes+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  smr_cv_with_Sgm_includes=
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $smr_cv_with_Sgm_includes" >&5
-$as_echo "$smr_cv_with_Sgm_includes" >&6; }
-
-  if test ! x"$smr_cv_with_Sgm_includes" = x; then
-    if test -d "$smr_cv_with_Sgm_includes"; then
-      Sgm_CFLAGS="-I$smr_cv_with_Sgm_includes"
-    else
-      as_fn_error $? "argument must be a directory" "$LINENO" 5
-    fi
-  else
-    Sgm_CFLAGS=
-  fi
-
-        smr_test_CPPFLAGS="${CPPFLAGS+set}"
-  smr_save_CPPFLAGS="$CPPFLAGS"
-  CPPFLAGS="$CPPFLAGS $Sgm_CFLAGS $X_CFLAGS"
-
-      for ac_header in Sgm/HPanedW.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "Sgm/HPanedW.h" "ac_cv_header_Sgm_HPanedW_h" "$ac_includes_default"
-if test "x$ac_cv_header_Sgm_HPanedW_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_SGM_HPANEDW_H 1
-_ACEOF
- smr_have_Sgm_header=yes
-else
-  smr_have_Sgm_header=no
-fi
-
-done
-
-
-  if test x"$smr_test_CPPFLAGS" = xset; then
-    CPPFLAGS=$smr_save_CPPFLAGS
-  else
-    unset CPPFLAGS
-  fi
-
-
-
-
-
-
-
-    # We need only look for the library if the header has been found
-    # (or no header is needed).
-    if test $smr_have_Sgm_header != no; then
-
-       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SgCreateHorzPanedWindow in -lSgm" >&5
-$as_echo_n "checking for SgCreateHorzPanedWindow in -lSgm... " >&6; }
-if ${ac_cv_lib_Sgm_SgCreateHorzPanedWindow+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lSgm $Sgm_CFLAGS $X_CFLAGS $Sgm_LIBS $Xm_LIBS $Xt_LIBS $X_LIBS $X_PRE_LIBS $Xp_LIBS $Xext_LIBS $X_EXTRA_LIBS -lX11 $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char SgCreateHorzPanedWindow ();
-int
-main ()
-{
-return SgCreateHorzPanedWindow ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_Sgm_SgCreateHorzPanedWindow=yes
-else
-  ac_cv_lib_Sgm_SgCreateHorzPanedWindow=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Sgm_SgCreateHorzPanedWindow" >&5
-$as_echo "$ac_cv_lib_Sgm_SgCreateHorzPanedWindow" >&6; }
-if test "x$ac_cv_lib_Sgm_SgCreateHorzPanedWindow" = xyes; then :
-  smr_have_Sgm_library=yes
-else
-  smr_have_Sgm_library=no
-fi
-
-    fi
-
-    if test x"$smr_have_Sgm_library" = xyes; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: result: using Sgm library" >&5
-$as_echo "using Sgm library" >&6; }
-    else
-      Sgm_LIBS=
-      Sgm_CFLAGS=
-
-      if test x"$with_Sgm" = xmaybe; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: not using Sgm library" >&5
-$as_echo "not using Sgm library" >&6; }
-      else
-        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: requested Sgm library not found!" >&5
-$as_echo "$as_me: WARNING: requested Sgm library not found!" >&2;}
-      fi
-    fi
-  fi
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-    if test "x$smr_have_Xt_library" = xyes; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XtAppSetExitFlag in -lXt" >&5
-$as_echo_n "checking for XtAppSetExitFlag in -lXt... " >&6; }
-if ${ac_cv_lib_Xt_XtAppSetExitFlag+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lXt $Xt_LIBS $X_LIBS $X_PRE_LIBS $Xp_LIBS $Xext_LIBS $X_EXTRA_LIBS -lX11 $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char XtAppSetExitFlag ();
-int
-main ()
-{
-return XtAppSetExitFlag ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_Xt_XtAppSetExitFlag=yes
-else
-  ac_cv_lib_Xt_XtAppSetExitFlag=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xt_XtAppSetExitFlag" >&5
-$as_echo "$ac_cv_lib_Xt_XtAppSetExitFlag" >&6; }
-if test "x$ac_cv_lib_Xt_XtAppSetExitFlag" = xyes; then :
-  $as_echo "#define HAVE_XTAPPSETEXITFLAG 1" >>confdefs.h
-
-fi
-
-  fi
-fi
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-# Check whether --with-freetype2-library was given.
-if test "${with_freetype2_library+set}" = set; then :
-  withval=$with_freetype2_library; smr_cv_with_freetype2_library=$withval
-fi
-
-
-      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use freetype2 library" >&5
-$as_echo_n "checking whether to use freetype2 library... " >&6; }
-if ${smr_cv_with_freetype2_library+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  smr_cv_with_freetype2_library=maybe
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $smr_cv_with_freetype2_library" >&5
-$as_echo "$smr_cv_with_freetype2_library" >&6; }
-
-
-  case x"$smr_cv_with_freetype2_library" in
-      xyes | xmaybe)
-          freetype2_LIBS="-lfreetype"
-          with_freetype2=$smr_cv_with_freetype2_library
-          ;;
-      xno)
-          freetype2_LIBS=
-          with_freetype2=no
-          ;;
-      *)
-          if test -f "$smr_cv_with_freetype2_library"; then
-            freetype2_LIBS=$smr_cv_with_freetype2_library
-          elif test -d "$smr_cv_with_freetype2_library"; then
-            freetype2_LIBS="-L$smr_cv_with_freetype2_library -lfreetype"
-          else
-            as_fn_error $? "argument must be boolean, file, or directory" "$LINENO" 5
-          fi
-          with_freetype2=yes
-          ;;
-  esac
-
-
-
-
-
-
-
-  if test ! x"$with_freetype2" = xno; then
-
-    # If we got this far, then the user didn't explicitly ask not to use
-    # the library.
-
-
-
-
-
-
-
-
-# Check whether --with-freetype2-includes was given.
-if test "${with_freetype2_includes+set}" = set; then :
-  withval=$with_freetype2_includes; smr_cv_with_freetype2_includes=$withval
-fi
-
-
-      { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the freetype2 header files" >&5
-$as_echo_n "checking where to find the freetype2 header files... " >&6; }
-if ${smr_cv_with_freetype2_includes+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  smr_cv_with_freetype2_includes=
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $smr_cv_with_freetype2_includes" >&5
-$as_echo "$smr_cv_with_freetype2_includes" >&6; }
-
-  if test ! x"$smr_cv_with_freetype2_includes" = x; then
-    if test -d "$smr_cv_with_freetype2_includes"; then
-      freetype2_CFLAGS="-I$smr_cv_with_freetype2_includes"
-    else
-      as_fn_error $? "argument must be a directory" "$LINENO" 5
-    fi
-  else
-    freetype2_CFLAGS=
-  fi
-
-        smr_test_CPPFLAGS="${CPPFLAGS+set}"
-  smr_save_CPPFLAGS="$CPPFLAGS"
-  CPPFLAGS="$CPPFLAGS $freetype2_CFLAGS "
-
-      for ac_header in ft2build.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "ft2build.h" "ac_cv_header_ft2build_h" "$ac_includes_default"
-if test "x$ac_cv_header_ft2build_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_FT2BUILD_H 1
-_ACEOF
- smr_have_freetype2_header=yes
-else
-  smr_have_freetype2_header=no
-fi
-
-done
-
-
-  if test x"$smr_test_CPPFLAGS" = xset; then
-    CPPFLAGS=$smr_save_CPPFLAGS
-  else
-    unset CPPFLAGS
-  fi
-
-
-
-
-
-
-
-    # We need only look for the library if the header has been found
-    # (or no header is needed).
-    if test $smr_have_freetype2_header != no; then
-
-       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for FT_Get_Name_Index in -lfreetype" >&5
-$as_echo_n "checking for FT_Get_Name_Index in -lfreetype... " >&6; }
-if ${ac_cv_lib_freetype_FT_Get_Name_Index+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lfreetype $freetype2_CFLAGS  $freetype2_LIBS -lm $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char FT_Get_Name_Index ();
-int
-main ()
-{
-return FT_Get_Name_Index ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_freetype_FT_Get_Name_Index=yes
-else
-  ac_cv_lib_freetype_FT_Get_Name_Index=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_freetype_FT_Get_Name_Index" >&5
-$as_echo "$ac_cv_lib_freetype_FT_Get_Name_Index" >&6; }
-if test "x$ac_cv_lib_freetype_FT_Get_Name_Index" = xyes; then :
-  smr_have_freetype2_library=yes
-else
-  smr_have_freetype2_library=no
-fi
-
-    fi
-
-    if test x"$smr_have_freetype2_library" = xyes; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: result: using freetype2 library" >&5
-$as_echo "using freetype2 library" >&6; }
-    else
-      freetype2_LIBS=
-      freetype2_CFLAGS=
-
-      if test x"$with_freetype2" = xmaybe; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: not using freetype2 library" >&5
-$as_echo "not using freetype2 library" >&6; }
-      else
-        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: requested freetype2 library not found!" >&5
-$as_echo "$as_me: WARNING: requested freetype2 library not found!" >&2;}
-      fi
-    fi
-  fi
-
-
-
-
-
-
-
-
-
-
-
-
-
-if test "x$smr_have_freetype2_library" = xyes; then
-  $as_echo "#define HAVE_FREETYPE_FREETYPE_H 1" >>confdefs.h
-
-  $as_echo "#define HAVE_SPLASH 1" >>confdefs.h
-
-fi
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-# Check whether --with-libpng-library was given.
-if test "${with_libpng_library+set}" = set; then :
-  withval=$with_libpng_library; smr_cv_with_libpng_library=$withval
-fi
-
-
-      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use libpng library" >&5
-$as_echo_n "checking whether to use libpng library... " >&6; }
-if ${smr_cv_with_libpng_library+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  smr_cv_with_libpng_library=maybe
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $smr_cv_with_libpng_library" >&5
-$as_echo "$smr_cv_with_libpng_library" >&6; }
-
-
-  case x"$smr_cv_with_libpng_library" in
-      xyes | xmaybe)
-          libpng_LIBS="-lpng"
-          with_libpng=$smr_cv_with_libpng_library
-          ;;
-      xno)
-          libpng_LIBS=
-          with_libpng=no
-          ;;
-      *)
-          if test -f "$smr_cv_with_libpng_library"; then
-            libpng_LIBS=$smr_cv_with_libpng_library
-          elif test -d "$smr_cv_with_libpng_library"; then
-            libpng_LIBS="-L$smr_cv_with_libpng_library -lpng"
-          else
-            as_fn_error $? "argument must be boolean, file, or directory" "$LINENO" 5
-          fi
-          with_libpng=yes
-          ;;
-  esac
-
-
-
-
-
-
-
-  if test ! x"$with_libpng" = xno; then
-
-    # If we got this far, then the user didn't explicitly ask not to use
-    # the library.
-
-
-
-
-
-
-
-
-# Check whether --with-libpng-includes was given.
-if test "${with_libpng_includes+set}" = set; then :
-  withval=$with_libpng_includes; smr_cv_with_libpng_includes=$withval
-fi
-
-
-      { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the libpng header files" >&5
-$as_echo_n "checking where to find the libpng header files... " >&6; }
-if ${smr_cv_with_libpng_includes+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  smr_cv_with_libpng_includes=
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $smr_cv_with_libpng_includes" >&5
-$as_echo "$smr_cv_with_libpng_includes" >&6; }
-
-  if test ! x"$smr_cv_with_libpng_includes" = x; then
-    if test -d "$smr_cv_with_libpng_includes"; then
-      libpng_CFLAGS="-I$smr_cv_with_libpng_includes"
-    else
-      as_fn_error $? "argument must be a directory" "$LINENO" 5
-    fi
-  else
-    libpng_CFLAGS=
-  fi
-
-        smr_test_CPPFLAGS="${CPPFLAGS+set}"
-  smr_save_CPPFLAGS="$CPPFLAGS"
-  CPPFLAGS="$CPPFLAGS $libpng_CFLAGS "
-
-      for ac_header in png.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "png.h" "ac_cv_header_png_h" "$ac_includes_default"
-if test "x$ac_cv_header_png_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_PNG_H 1
-_ACEOF
- smr_have_libpng_header=yes
-else
-  smr_have_libpng_header=no
-fi
-
-done
-
-
-  if test x"$smr_test_CPPFLAGS" = xset; then
-    CPPFLAGS=$smr_save_CPPFLAGS
-  else
-    unset CPPFLAGS
-  fi
-
-
-
-
-
-
-
-    # We need only look for the library if the header has been found
-    # (or no header is needed).
-    if test $smr_have_libpng_header != no; then
-
-       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for png_write_row in -lpng" >&5
-$as_echo_n "checking for png_write_row in -lpng... " >&6; }
-if ${ac_cv_lib_png_png_write_row+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lpng $libpng_CFLAGS  $libpng_LIBS -lz $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char png_write_row ();
-int
-main ()
-{
-return png_write_row ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_png_png_write_row=yes
-else
-  ac_cv_lib_png_png_write_row=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_png_png_write_row" >&5
-$as_echo "$ac_cv_lib_png_png_write_row" >&6; }
-if test "x$ac_cv_lib_png_png_write_row" = xyes; then :
-  smr_have_libpng_library=yes
-else
-  smr_have_libpng_library=no
-fi
-
-    fi
-
-    if test x"$smr_have_libpng_library" = xyes; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: result: using libpng library" >&5
-$as_echo "using libpng library" >&6; }
-    else
-      libpng_LIBS=
-      libpng_CFLAGS=
-
-      if test x"$with_libpng" = xmaybe; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: not using libpng library" >&5
-$as_echo "not using libpng library" >&6; }
-      else
-        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: requested libpng library not found!" >&5
-$as_echo "$as_me: WARNING: requested libpng library not found!" >&2;}
-      fi
-    fi
-  fi
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-# Check whether --with-libpaper-library was given.
-if test "${with_libpaper_library+set}" = set; then :
-  withval=$with_libpaper_library; smr_cv_with_libpaper_library=$withval
-fi
-
-
-      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use libpaper library" >&5
-$as_echo_n "checking whether to use libpaper library... " >&6; }
-if ${smr_cv_with_libpaper_library+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  smr_cv_with_libpaper_library=maybe
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $smr_cv_with_libpaper_library" >&5
-$as_echo "$smr_cv_with_libpaper_library" >&6; }
-
-
-  case x"$smr_cv_with_libpaper_library" in
-      xyes | xmaybe)
-          libpaper_LIBS="-lpaper"
-          with_libpaper=$smr_cv_with_libpaper_library
-          ;;
-      xno)
-          libpaper_LIBS=
-          with_libpaper=no
-          ;;
-      *)
-          if test -f "$smr_cv_with_libpaper_library"; then
-            libpaper_LIBS=$smr_cv_with_libpaper_library
-          elif test -d "$smr_cv_with_libpaper_library"; then
-            libpaper_LIBS="-L$smr_cv_with_libpaper_library -lpaper"
-          else
-            as_fn_error $? "argument must be boolean, file, or directory" "$LINENO" 5
-          fi
-          with_libpaper=yes
-          ;;
-  esac
-
-
-
-
-
-
-
-  if test ! x"$with_libpaper" = xno; then
-
-    # If we got this far, then the user didn't explicitly ask not to use
-    # the library.
-
-
-
-
-
-
-
-
-# Check whether --with-libpaper-includes was given.
-if test "${with_libpaper_includes+set}" = set; then :
-  withval=$with_libpaper_includes; smr_cv_with_libpaper_includes=$withval
-fi
-
-
-      { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the libpaper header files" >&5
-$as_echo_n "checking where to find the libpaper header files... " >&6; }
-if ${smr_cv_with_libpaper_includes+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  smr_cv_with_libpaper_includes=
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $smr_cv_with_libpaper_includes" >&5
-$as_echo "$smr_cv_with_libpaper_includes" >&6; }
-
-  if test ! x"$smr_cv_with_libpaper_includes" = x; then
-    if test -d "$smr_cv_with_libpaper_includes"; then
-      libpaper_CFLAGS="-I$smr_cv_with_libpaper_includes"
-    else
-      as_fn_error $? "argument must be a directory" "$LINENO" 5
-    fi
-  else
-    libpaper_CFLAGS=
-  fi
-
-        smr_test_CPPFLAGS="${CPPFLAGS+set}"
-  smr_save_CPPFLAGS="$CPPFLAGS"
-  CPPFLAGS="$CPPFLAGS $libpaper_CFLAGS "
-
-      for ac_header in paper.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "paper.h" "ac_cv_header_paper_h" "$ac_includes_default"
-if test "x$ac_cv_header_paper_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_PAPER_H 1
-_ACEOF
- smr_have_libpaper_header=yes
-else
-  smr_have_libpaper_header=no
-fi
-
-done
-
-
-  if test x"$smr_test_CPPFLAGS" = xset; then
-    CPPFLAGS=$smr_save_CPPFLAGS
-  else
-    unset CPPFLAGS
-  fi
-
-
-
-
-
-
-
-    # We need only look for the library if the header has been found
-    # (or no header is needed).
-    if test $smr_have_libpaper_header != no; then
-
-       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for paperinit in -lpaper" >&5
-$as_echo_n "checking for paperinit in -lpaper... " >&6; }
-if ${ac_cv_lib_paper_paperinit+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lpaper $libpaper_CFLAGS  $libpaper_LIBS  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char paperinit ();
-int
-main ()
-{
-return paperinit ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_paper_paperinit=yes
-else
-  ac_cv_lib_paper_paperinit=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_paper_paperinit" >&5
-$as_echo "$ac_cv_lib_paper_paperinit" >&6; }
-if test "x$ac_cv_lib_paper_paperinit" = xyes; then :
-  smr_have_libpaper_library=yes
-else
-  smr_have_libpaper_library=no
-fi
-
-    fi
-
-    if test x"$smr_have_libpaper_library" = xyes; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: result: using libpaper library" >&5
-$as_echo "using libpaper library" >&6; }
-    else
-      libpaper_LIBS=
-      libpaper_CFLAGS=
-
-      if test x"$with_libpaper" = xmaybe; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: result: not using libpaper library" >&5
-$as_echo "not using libpaper library" >&6; }
-      else
-        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: requested libpaper library not found!" >&5
-$as_echo "$as_me: WARNING: requested libpaper library not found!" >&2;}
-      fi
-    fi
-  fi
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-if test -n "$no_x" -o "x$smr_have_Xm_library" != xyes -o "x$smr_have_freetype2_library" != xyes; then
-  X="#"
-  XPDF_TARGET="all-no-x"
-else
-  X=""
-  XPDF_TARGET="all"
-fi
-
-
-
-EXTRA_LIBS=
-EXTRA_CFLAGS=
-
-
-
-ac_config_files="$ac_config_files Makefile goo/Makefile fofi/Makefile splash/Makefile xpdf/Makefile"
-
-cat >confcache <<\_ACEOF
-# This file is a shell script that caches the results of configure
-# tests run on this system so they can be shared between configure
-# scripts and configure runs, see configure's option --config-cache.
-# It is not useful on other systems.  If it contains results you don't
-# want to keep, you may remove or edit it.
-#
-# config.status only pays attention to the cache file if you give it
-# the --recheck option to rerun configure.
-#
-# `ac_cv_env_foo' variables (set or unset) will be overridden when
-# loading this file, other *unset* `ac_cv_foo' will be assigned the
-# following values.
-
-_ACEOF
-
-# The following way of writing the cache mishandles newlines in values,
-# but we know of no workaround that is simple, portable, and efficient.
-# So, we kill variables containing newlines.
-# Ultrix sh set writes to stderr and can't be redirected directly,
-# and sets the high bit in the cache file unless we assign to the vars.
-(
-  for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
-    eval ac_val=\$$ac_var
-    case $ac_val in #(
-    *${as_nl}*)
-      case $ac_var in #(
-      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
-$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
-      esac
-      case $ac_var in #(
-      _ | IFS | as_nl) ;; #(
-      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
-      *) { eval $ac_var=; unset $ac_var;} ;;
-      esac ;;
-    esac
-  done
-
-  (set) 2>&1 |
-    case $as_nl`(ac_space=' '; set) 2>&1` in #(
-    *${as_nl}ac_space=\ *)
-      # `set' does not quote correctly, so add quotes: double-quote
-      # substitution turns \\\\ into \\, and sed turns \\ into \.
-      sed -n \
-	"s/'/'\\\\''/g;
-	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
-      ;; #(
-    *)
-      # `set' quotes correctly as required by POSIX, so do not add quotes.
-      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
-      ;;
-    esac |
-    sort
-) |
-  sed '
-     /^ac_cv_env_/b end
-     t clear
-     :clear
-     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
-     t end
-     s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
-     :end' >>confcache
-if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
-  if test -w "$cache_file"; then
-    if test "x$cache_file" != "x/dev/null"; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
-$as_echo "$as_me: updating cache $cache_file" >&6;}
-      if test ! -f "$cache_file" || test -h "$cache_file"; then
-	cat confcache >"$cache_file"
-      else
-        case $cache_file in #(
-        */* | ?:*)
-	  mv -f confcache "$cache_file"$$ &&
-	  mv -f "$cache_file"$$ "$cache_file" ;; #(
-        *)
-	  mv -f confcache "$cache_file" ;;
-	esac
-      fi
-    fi
-  else
-    { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
-$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
-  fi
-fi
-rm -f confcache
-
-test "x$prefix" = xNONE && prefix=$ac_default_prefix
-# Let make expand exec_prefix.
-test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
-
-DEFS=-DHAVE_CONFIG_H
-
-ac_libobjs=
-ac_ltlibobjs=
-U=
-for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
-  # 1. Remove the extension, and $U if already installed.
-  ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
-  ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
-  # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
-  #    will be set to the directory where LIBOBJS objects are built.
-  as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
-  as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
-done
-LIBOBJS=$ac_libobjs
-
-LTLIBOBJS=$ac_ltlibobjs
-
-
-
-: "${CONFIG_STATUS=./config.status}"
-ac_write_fail=0
-ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files $CONFIG_STATUS"
-{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
-$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
-as_write_fail=0
-cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
-#! $SHELL
-# Generated by $as_me.
-# Run this file to recreate the current configuration.
-# Compiler output produced by configure, useful for debugging
-# configure, is in config.log if it exists.
-
-debug=false
-ac_cs_recheck=false
-ac_cs_silent=false
-
-SHELL=\${CONFIG_SHELL-$SHELL}
-export SHELL
-_ASEOF
-cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
-## -------------------- ##
-## M4sh Initialization. ##
-## -------------------- ##
-
-# Be more Bourne compatible
-DUALCASE=1; export DUALCASE # for MKS sh
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
-  emulate sh
-  NULLCMD=:
-  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
-  # is contrary to our usage.  Disable this feature.
-  alias -g '${1+"$@"}'='"$@"'
-  setopt NO_GLOB_SUBST
-else
-  case `(set -o) 2>/dev/null` in #(
-  *posix*) :
-    set -o posix ;; #(
-  *) :
-     ;;
-esac
-fi
-
-
-as_nl='
-'
-export as_nl
-# Printing a long string crashes Solaris 7 /usr/bin/printf.
-as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
-# Prefer a ksh shell builtin over an external printf program on Solaris,
-# but without wasting forks for bash or zsh.
-if test -z "$BASH_VERSION$ZSH_VERSION" \
-    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
-  as_echo='print -r --'
-  as_echo_n='print -rn --'
-elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
-  as_echo='printf %s\n'
-  as_echo_n='printf %s'
-else
-  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
-    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
-    as_echo_n='/usr/ucb/echo -n'
-  else
-    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
-    as_echo_n_body='eval
-      arg=$1;
-      case $arg in #(
-      *"$as_nl"*)
-	expr "X$arg" : "X\\(.*\\)$as_nl";
-	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
-      esac;
-      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
-    '
-    export as_echo_n_body
-    as_echo_n='sh -c $as_echo_n_body as_echo'
-  fi
-  export as_echo_body
-  as_echo='sh -c $as_echo_body as_echo'
-fi
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
-  PATH_SEPARATOR=:
-  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
-    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
-      PATH_SEPARATOR=';'
-  }
-fi
-
-
-# IFS
-# We need space, tab and new line, in precisely that order.  Quoting is
-# there to prevent editors from complaining about space-tab.
-# (If _AS_PATH_WALK were called with IFS unset, it would disable word
-# splitting by setting IFS to empty value.)
-IFS=" ""	$as_nl"
-
-# Find who we are.  Look in the path if we contain no directory separator.
-as_myself=
-case $0 in #((
-  *[\\/]* ) as_myself=$0 ;;
-  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-  done
-IFS=$as_save_IFS
-
-     ;;
-esac
-# We did not find ourselves, most probably we were run as `sh COMMAND'
-# in which case we are not to be found in the path.
-if test "x$as_myself" = x; then
-  as_myself=$0
-fi
-if test ! -f "$as_myself"; then
-  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
-  exit 1
-fi
-
-# Unset variables that we do not need and which cause bugs (e.g. in
-# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
-# suppresses any "Segmentation fault" message there.  '((' could
-# trigger a bug in pdksh 5.2.14.
-for as_var in BASH_ENV ENV MAIL MAILPATH
-do eval test x\${$as_var+set} = xset \
-  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
-done
-PS1='$ '
-PS2='> '
-PS4='+ '
-
-# NLS nuisances.
-LC_ALL=C
-export LC_ALL
-LANGUAGE=C
-export LANGUAGE
-
-# CDPATH.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-
-# as_fn_error STATUS ERROR [LINENO LOG_FD]
-# ----------------------------------------
-# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
-# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
-# script with STATUS, using 1 if that was 0.
-as_fn_error ()
-{
-  as_status=$1; test $as_status -eq 0 && as_status=1
-  if test "$4"; then
-    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
-  fi
-  $as_echo "$as_me: error: $2" >&2
-  as_fn_exit $as_status
-} # as_fn_error
-
-
-# as_fn_set_status STATUS
-# -----------------------
-# Set $? to STATUS, without forking.
-as_fn_set_status ()
-{
-  return $1
-} # as_fn_set_status
-
-# as_fn_exit STATUS
-# -----------------
-# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
-as_fn_exit ()
-{
-  set +e
-  as_fn_set_status $1
-  exit $1
-} # as_fn_exit
-
-# as_fn_unset VAR
-# ---------------
-# Portably unset VAR.
-as_fn_unset ()
-{
-  { eval $1=; unset $1;}
-}
-as_unset=as_fn_unset
-# as_fn_append VAR VALUE
-# ----------------------
-# Append the text in VALUE to the end of the definition contained in VAR. Take
-# advantage of any shell optimizations that allow amortized linear growth over
-# repeated appends, instead of the typical quadratic growth present in naive
-# implementations.
-if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
-  eval 'as_fn_append ()
-  {
-    eval $1+=\$2
-  }'
-else
-  as_fn_append ()
-  {
-    eval $1=\$$1\$2
-  }
-fi # as_fn_append
-
-# as_fn_arith ARG...
-# ------------------
-# Perform arithmetic evaluation on the ARGs, and store the result in the
-# global $as_val. Take advantage of shells that can avoid forks. The arguments
-# must be portable across $(()) and expr.
-if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
-  eval 'as_fn_arith ()
-  {
-    as_val=$(( $* ))
-  }'
-else
-  as_fn_arith ()
-  {
-    as_val=`expr "$@" || test $? -eq 1`
-  }
-fi # as_fn_arith
-
-
-if expr a : '\(a\)' >/dev/null 2>&1 &&
-   test "X`expr 00001 : '.*\(...\)'`" = X001; then
-  as_expr=expr
-else
-  as_expr=false
-fi
-
-if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
-  as_basename=basename
-else
-  as_basename=false
-fi
-
-if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
-  as_dirname=dirname
-else
-  as_dirname=false
-fi
-
-as_me=`$as_basename -- "$0" ||
-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
-	 X"$0" : 'X\(//\)$' \| \
-	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X/"$0" |
-    sed '/^.*\/\([^/][^/]*\)\/*$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\/\(\/\/\)$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\/\(\/\).*/{
-	    s//\1/
-	    q
-	  }
-	  s/.*/./; q'`
-
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
-ECHO_C= ECHO_N= ECHO_T=
-case `echo -n x` in #(((((
--n*)
-  case `echo 'xy\c'` in
-  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
-  xy)  ECHO_C='\c';;
-  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
-       ECHO_T='	';;
-  esac;;
-*)
-  ECHO_N='-n';;
-esac
-
-rm -f conf$$ conf$$.exe conf$$.file
-if test -d conf$$.dir; then
-  rm -f conf$$.dir/conf$$.file
-else
-  rm -f conf$$.dir
-  mkdir conf$$.dir 2>/dev/null
-fi
-if (echo >conf$$.file) 2>/dev/null; then
-  if ln -s conf$$.file conf$$ 2>/dev/null; then
-    as_ln_s='ln -s'
-    # ... but there are two gotchas:
-    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
-    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
-    # In both cases, we have to default to `cp -pR'.
-    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
-      as_ln_s='cp -pR'
-  elif ln conf$$.file conf$$ 2>/dev/null; then
-    as_ln_s=ln
-  else
-    as_ln_s='cp -pR'
-  fi
-else
-  as_ln_s='cp -pR'
-fi
-rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
-rmdir conf$$.dir 2>/dev/null
-
-
-# as_fn_mkdir_p
-# -------------
-# Create "$as_dir" as a directory, including parents if necessary.
-as_fn_mkdir_p ()
-{
-
-  case $as_dir in #(
-  -*) as_dir=./$as_dir;;
-  esac
-  test -d "$as_dir" || eval $as_mkdir_p || {
-    as_dirs=
-    while :; do
-      case $as_dir in #(
-      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
-      *) as_qdir=$as_dir;;
-      esac
-      as_dirs="'$as_qdir' $as_dirs"
-      as_dir=`$as_dirname -- "$as_dir" ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	 X"$as_dir" : 'X\(//\)[^/]' \| \
-	 X"$as_dir" : 'X\(//\)$' \| \
-	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$as_dir" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\/\)[^/].*/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\/\)$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\).*/{
-	    s//\1/
-	    q
-	  }
-	  s/.*/./; q'`
-      test -d "$as_dir" && break
-    done
-    test -z "$as_dirs" || eval "mkdir $as_dirs"
-  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
-
-
-} # as_fn_mkdir_p
-if mkdir -p . 2>/dev/null; then
-  as_mkdir_p='mkdir -p "$as_dir"'
-else
-  test -d ./-p && rmdir ./-p
-  as_mkdir_p=false
-fi
-
-
-# as_fn_executable_p FILE
-# -----------------------
-# Test if FILE is an executable regular file.
-as_fn_executable_p ()
-{
-  test -f "$1" && test -x "$1"
-} # as_fn_executable_p
-as_test_x='test -x'
-as_executable_p=as_fn_executable_p
-
-# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
-
-# Sed expression to map a string onto a valid variable name.
-as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
-
-
-exec 6>&1
-## ----------------------------------- ##
-## Main body of $CONFIG_STATUS script. ##
-## ----------------------------------- ##
-_ASEOF
-test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-# Save the log message, to keep $0 and so on meaningful, and to
-# report actual input values of CONFIG_FILES etc. instead of their
-# values after options handling.
-ac_log="
-This file was extended by $as_me, which was
-generated by GNU Autoconf 2.69.  Invocation command line was
-
-  CONFIG_FILES    = $CONFIG_FILES
-  CONFIG_HEADERS  = $CONFIG_HEADERS
-  CONFIG_LINKS    = $CONFIG_LINKS
-  CONFIG_COMMANDS = $CONFIG_COMMANDS
-  $ $0 $@
-
-on `(hostname || uname -n) 2>/dev/null | sed 1q`
-"
-
-_ACEOF
-
-case $ac_config_files in *"
-"*) set x $ac_config_files; shift; ac_config_files=$*;;
-esac
-
-case $ac_config_headers in *"
-"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
-esac
-
-
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-# Files that config.status was made for.
-config_files="$ac_config_files"
-config_headers="$ac_config_headers"
-
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-ac_cs_usage="\
-\`$as_me' instantiates files and other configuration actions
-from templates according to the current configuration.  Unless the files
-and actions are specified as TAGs, all are instantiated by default.
-
-Usage: $0 [OPTION]... [TAG]...
-
-  -h, --help       print this help, then exit
-  -V, --version    print version number and configuration settings, then exit
-      --config     print configuration, then exit
-  -q, --quiet, --silent
-                   do not print progress messages
-  -d, --debug      don't remove temporary files
-      --recheck    update $as_me by reconfiguring in the same conditions
-      --file=FILE[:TEMPLATE]
-                   instantiate the configuration file FILE
-      --header=FILE[:TEMPLATE]
-                   instantiate the configuration header FILE
-
-Configuration files:
-$config_files
-
-Configuration headers:
-$config_headers
-
-Report bugs to the package provider."
-
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
-ac_cs_version="\\
-config.status
-configured by $0, generated by GNU Autoconf 2.69,
-  with options \\"\$ac_cs_config\\"
-
-Copyright (C) 2012 Free Software Foundation, Inc.
-This config.status script is free software; the Free Software Foundation
-gives unlimited permission to copy, distribute and modify it."
-
-ac_pwd='$ac_pwd'
-srcdir='$srcdir'
-INSTALL='$INSTALL'
-test -n "\$AWK" || AWK=awk
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-# The default lists apply if the user does not specify any file.
-ac_need_defaults=:
-while test $# != 0
-do
-  case $1 in
-  --*=?*)
-    ac_option=`expr "X$1" : 'X\([^=]*\)='`
-    ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
-    ac_shift=:
-    ;;
-  --*=)
-    ac_option=`expr "X$1" : 'X\([^=]*\)='`
-    ac_optarg=
-    ac_shift=:
-    ;;
-  *)
-    ac_option=$1
-    ac_optarg=$2
-    ac_shift=shift
-    ;;
-  esac
-
-  case $ac_option in
-  # Handling of the options.
-  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
-    ac_cs_recheck=: ;;
-  --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
-    $as_echo "$ac_cs_version"; exit ;;
-  --config | --confi | --conf | --con | --co | --c )
-    $as_echo "$ac_cs_config"; exit ;;
-  --debug | --debu | --deb | --de | --d | -d )
-    debug=: ;;
-  --file | --fil | --fi | --f )
-    $ac_shift
-    case $ac_optarg in
-    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
-    '') as_fn_error $? "missing file argument" ;;
-    esac
-    as_fn_append CONFIG_FILES " '$ac_optarg'"
-    ac_need_defaults=false;;
-  --header | --heade | --head | --hea )
-    $ac_shift
-    case $ac_optarg in
-    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
-    esac
-    as_fn_append CONFIG_HEADERS " '$ac_optarg'"
-    ac_need_defaults=false;;
-  --he | --h)
-    # Conflict between --help and --header
-    as_fn_error $? "ambiguous option: \`$1'
-Try \`$0 --help' for more information.";;
-  --help | --hel | -h )
-    $as_echo "$ac_cs_usage"; exit ;;
-  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
-  | -silent | --silent | --silen | --sile | --sil | --si | --s)
-    ac_cs_silent=: ;;
-
-  # This is an error.
-  -*) as_fn_error $? "unrecognized option: \`$1'
-Try \`$0 --help' for more information." ;;
-
-  *) as_fn_append ac_config_targets " $1"
-     ac_need_defaults=false ;;
-
-  esac
-  shift
-done
-
-ac_configure_extra_args=
-
-if $ac_cs_silent; then
-  exec 6>/dev/null
-  ac_configure_extra_args="$ac_configure_extra_args --silent"
-fi
-
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-if \$ac_cs_recheck; then
-  set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
-  shift
-  \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
-  CONFIG_SHELL='$SHELL'
-  export CONFIG_SHELL
-  exec "\$@"
-fi
-
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-exec 5>>config.log
-{
-  echo
-  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
-## Running $as_me. ##
-_ASBOX
-  $as_echo "$ac_log"
-} >&5
-
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-
-# Handling of arguments.
-for ac_config_target in $ac_config_targets
-do
-  case $ac_config_target in
-    "aconf.h") CONFIG_HEADERS="$CONFIG_HEADERS aconf.h" ;;
-    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
-    "goo/Makefile") CONFIG_FILES="$CONFIG_FILES goo/Makefile" ;;
-    "fofi/Makefile") CONFIG_FILES="$CONFIG_FILES fofi/Makefile" ;;
-    "splash/Makefile") CONFIG_FILES="$CONFIG_FILES splash/Makefile" ;;
-    "xpdf/Makefile") CONFIG_FILES="$CONFIG_FILES xpdf/Makefile" ;;
-
-  *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
-  esac
-done
-
-
-# If the user did not use the arguments to specify the items to instantiate,
-# then the envvar interface is used.  Set only those that are not.
-# We use the long form for the default assignment because of an extremely
-# bizarre bug on SunOS 4.1.3.
-if $ac_need_defaults; then
-  test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
-  test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
-fi
-
-# Have a temporary directory for convenience.  Make it in the build tree
-# simply because there is no reason against having it here, and in addition,
-# creating and moving files from /tmp can sometimes cause problems.
-# Hook for its removal unless debugging.
-# Note that there is a small window in which the directory will not be cleaned:
-# after its creation but before its name has been assigned to `$tmp'.
-$debug ||
-{
-  tmp= ac_tmp=
-  trap 'exit_status=$?
-  : "${ac_tmp:=$tmp}"
-  { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
-' 0
-  trap 'as_fn_exit 1' 1 2 13 15
-}
-# Create a (secure) tmp directory for tmp files.
-
-{
-  tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
-  test -d "$tmp"
-}  ||
-{
-  tmp=./conf$$-$RANDOM
-  (umask 077 && mkdir "$tmp")
-} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
-ac_tmp=$tmp
-
-# Set up the scripts for CONFIG_FILES section.
-# No need to generate them if there are no CONFIG_FILES.
-# This happens for instance with `./config.status config.h'.
-if test -n "$CONFIG_FILES"; then
-
-
-ac_cr=`echo X | tr X '\015'`
-# On cygwin, bash can eat \r inside `` if the user requested igncr.
-# But we know of no other shell where ac_cr would be empty at this
-# point, so we can use a bashism as a fallback.
-if test "x$ac_cr" = x; then
-  eval ac_cr=\$\'\\r\'
-fi
-ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
-if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
-  ac_cs_awk_cr='\\r'
-else
-  ac_cs_awk_cr=$ac_cr
-fi
-
-echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
-_ACEOF
-
-
-{
-  echo "cat >conf$$subs.awk <<_ACEOF" &&
-  echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
-  echo "_ACEOF"
-} >conf$$subs.sh ||
-  as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
-ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
-ac_delim='%!_!# '
-for ac_last_try in false false false false false :; do
-  . ./conf$$subs.sh ||
-    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
-
-  ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
-  if test $ac_delim_n = $ac_delim_num; then
-    break
-  elif $ac_last_try; then
-    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
-  else
-    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
-  fi
-done
-rm -f conf$$subs.sh
-
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
-_ACEOF
-sed -n '
-h
-s/^/S["/; s/!.*/"]=/
-p
-g
-s/^[^!]*!//
-:repl
-t repl
-s/'"$ac_delim"'$//
-t delim
-:nl
-h
-s/\(.\{148\}\)..*/\1/
-t more1
-s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
-p
-n
-b repl
-:more1
-s/["\\]/\\&/g; s/^/"/; s/$/"\\/
-p
-g
-s/.\{148\}//
-t nl
-:delim
-h
-s/\(.\{148\}\)..*/\1/
-t more2
-s/["\\]/\\&/g; s/^/"/; s/$/"/
-p
-b
-:more2
-s/["\\]/\\&/g; s/^/"/; s/$/"\\/
-p
-g
-s/.\{148\}//
-t delim
-' <conf$$subs.awk | sed '
-/^[^""]/{
-  N
-  s/\n//
-}
-' >>$CONFIG_STATUS || ac_write_fail=1
-rm -f conf$$subs.awk
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-_ACAWK
-cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
-  for (key in S) S_is_set[key] = 1
-  FS = ""
-
-}
-{
-  line = $ 0
-  nfields = split(line, field, "@")
-  substed = 0
-  len = length(field[1])
-  for (i = 2; i < nfields; i++) {
-    key = field[i]
-    keylen = length(key)
-    if (S_is_set[key]) {
-      value = S[key]
-      line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
-      len += length(value) + length(field[++i])
-      substed = 1
-    } else
-      len += 1 + keylen
-  }
-
-  print line
-}
-
-_ACAWK
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
-  sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
-else
-  cat
-fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
-  || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
-_ACEOF
-
-# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
-# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
-# trailing colons and then remove the whole line if VPATH becomes empty
-# (actually we leave an empty line to preserve line numbers).
-if test "x$srcdir" = x.; then
-  ac_vpsub='/^[	 ]*VPATH[	 ]*=[	 ]*/{
-h
-s///
-s/^/:/
-s/[	 ]*$/:/
-s/:\$(srcdir):/:/g
-s/:\${srcdir}:/:/g
-s/:@srcdir@:/:/g
-s/^:*//
-s/:*$//
-x
-s/\(=[	 ]*\).*/\1/
-G
-s/\n//
-s/^[^=]*=[	 ]*$//
-}'
-fi
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-fi # test -n "$CONFIG_FILES"
-
-# Set up the scripts for CONFIG_HEADERS section.
-# No need to generate them if there are no CONFIG_HEADERS.
-# This happens for instance with `./config.status Makefile'.
-if test -n "$CONFIG_HEADERS"; then
-cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
-BEGIN {
-_ACEOF
-
-# Transform confdefs.h into an awk script `defines.awk', embedded as
-# here-document in config.status, that substitutes the proper values into
-# config.h.in to produce config.h.
-
-# Create a delimiter string that does not exist in confdefs.h, to ease
-# handling of long lines.
-ac_delim='%!_!# '
-for ac_last_try in false false :; do
-  ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
-  if test -z "$ac_tt"; then
-    break
-  elif $ac_last_try; then
-    as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
-  else
-    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
-  fi
-done
-
-# For the awk script, D is an array of macro values keyed by name,
-# likewise P contains macro parameters if any.  Preserve backslash
-# newline sequences.
-
-ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
-sed -n '
-s/.\{148\}/&'"$ac_delim"'/g
-t rset
-:rset
-s/^[	 ]*#[	 ]*define[	 ][	 ]*/ /
-t def
-d
-:def
-s/\\$//
-t bsnl
-s/["\\]/\\&/g
-s/^ \('"$ac_word_re"'\)\(([^()]*)\)[	 ]*\(.*\)/P["\1"]="\2"\
-D["\1"]=" \3"/p
-s/^ \('"$ac_word_re"'\)[	 ]*\(.*\)/D["\1"]=" \2"/p
-d
-:bsnl
-s/["\\]/\\&/g
-s/^ \('"$ac_word_re"'\)\(([^()]*)\)[	 ]*\(.*\)/P["\1"]="\2"\
-D["\1"]=" \3\\\\\\n"\\/p
-t cont
-s/^ \('"$ac_word_re"'\)[	 ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
-t cont
-d
-:cont
-n
-s/.\{148\}/&'"$ac_delim"'/g
-t clear
-:clear
-s/\\$//
-t bsnlc
-s/["\\]/\\&/g; s/^/"/; s/$/"/p
-d
-:bsnlc
-s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
-b cont
-' <confdefs.h | sed '
-s/'"$ac_delim"'/"\\\
-"/g' >>$CONFIG_STATUS || ac_write_fail=1
-
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-  for (key in D) D_is_set[key] = 1
-  FS = ""
-}
-/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
-  line = \$ 0
-  split(line, arg, " ")
-  if (arg[1] == "#") {
-    defundef = arg[2]
-    mac1 = arg[3]
-  } else {
-    defundef = substr(arg[1], 2)
-    mac1 = arg[2]
-  }
-  split(mac1, mac2, "(") #)
-  macro = mac2[1]
-  prefix = substr(line, 1, index(line, defundef) - 1)
-  if (D_is_set[macro]) {
-    # Preserve the white space surrounding the "#".
-    print prefix "define", macro P[macro] D[macro]
-    next
-  } else {
-    # Replace #undef with comments.  This is necessary, for example,
-    # in the case of _POSIX_SOURCE, which is predefined and required
-    # on some systems where configure will not decide to define it.
-    if (defundef == "undef") {
-      print "/*", prefix defundef, macro, "*/"
-      next
-    }
-  }
-}
-{ print }
-_ACAWK
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-  as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
-fi # test -n "$CONFIG_HEADERS"
-
-
-eval set X "  :F $CONFIG_FILES  :H $CONFIG_HEADERS    "
-shift
-for ac_tag
-do
-  case $ac_tag in
-  :[FHLC]) ac_mode=$ac_tag; continue;;
-  esac
-  case $ac_mode$ac_tag in
-  :[FHL]*:*);;
-  :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
-  :[FH]-) ac_tag=-:-;;
-  :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
-  esac
-  ac_save_IFS=$IFS
-  IFS=:
-  set x $ac_tag
-  IFS=$ac_save_IFS
-  shift
-  ac_file=$1
-  shift
-
-  case $ac_mode in
-  :L) ac_source=$1;;
-  :[FH])
-    ac_file_inputs=
-    for ac_f
-    do
-      case $ac_f in
-      -) ac_f="$ac_tmp/stdin";;
-      *) # Look for the file first in the build tree, then in the source tree
-	 # (if the path is not absolute).  The absolute path cannot be DOS-style,
-	 # because $ac_f cannot contain `:'.
-	 test -f "$ac_f" ||
-	   case $ac_f in
-	   [\\/$]*) false;;
-	   *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
-	   esac ||
-	   as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
-      esac
-      case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
-      as_fn_append ac_file_inputs " '$ac_f'"
-    done
-
-    # Let's still pretend it is `configure' which instantiates (i.e., don't
-    # use $as_me), people would be surprised to read:
-    #    /* config.h.  Generated by config.status.  */
-    configure_input='Generated from '`
-	  $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
-	`' by configure.'
-    if test x"$ac_file" != x-; then
-      configure_input="$ac_file.  $configure_input"
-      { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
-$as_echo "$as_me: creating $ac_file" >&6;}
-    fi
-    # Neutralize special characters interpreted by sed in replacement strings.
-    case $configure_input in #(
-    *\&* | *\|* | *\\* )
-       ac_sed_conf_input=`$as_echo "$configure_input" |
-       sed 's/[\\\\&|]/\\\\&/g'`;; #(
-    *) ac_sed_conf_input=$configure_input;;
-    esac
-
-    case $ac_tag in
-    *:-:* | *:-) cat >"$ac_tmp/stdin" \
-      || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
-    esac
-    ;;
-  esac
-
-  ac_dir=`$as_dirname -- "$ac_file" ||
-$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	 X"$ac_file" : 'X\(//\)[^/]' \| \
-	 X"$ac_file" : 'X\(//\)$' \| \
-	 X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$ac_file" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\/\)[^/].*/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\/\)$/{
-	    s//\1/
-	    q
-	  }
-	  /^X\(\/\).*/{
-	    s//\1/
-	    q
-	  }
-	  s/.*/./; q'`
-  as_dir="$ac_dir"; as_fn_mkdir_p
-  ac_builddir=.
-
-case "$ac_dir" in
-.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
-*)
-  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
-  # A ".." for each directory in $ac_dir_suffix.
-  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
-  case $ac_top_builddir_sub in
-  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
-  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
-  esac ;;
-esac
-ac_abs_top_builddir=$ac_pwd
-ac_abs_builddir=$ac_pwd$ac_dir_suffix
-# for backward compatibility:
-ac_top_builddir=$ac_top_build_prefix
-
-case $srcdir in
-  .)  # We are building in place.
-    ac_srcdir=.
-    ac_top_srcdir=$ac_top_builddir_sub
-    ac_abs_top_srcdir=$ac_pwd ;;
-  [\\/]* | ?:[\\/]* )  # Absolute name.
-    ac_srcdir=$srcdir$ac_dir_suffix;
-    ac_top_srcdir=$srcdir
-    ac_abs_top_srcdir=$srcdir ;;
-  *) # Relative name.
-    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
-    ac_top_srcdir=$ac_top_build_prefix$srcdir
-    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
-esac
-ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
-
-
-  case $ac_mode in
-  :F)
-  #
-  # CONFIG_FILE
-  #
-
-  case $INSTALL in
-  [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
-  *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
-  esac
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-# If the template does not know about datarootdir, expand it.
-# FIXME: This hack should be removed a few years after 2.60.
-ac_datarootdir_hack=; ac_datarootdir_seen=
-ac_sed_dataroot='
-/datarootdir/ {
-  p
-  q
-}
-/@datadir@/p
-/@docdir@/p
-/@infodir@/p
-/@localedir@/p
-/@mandir@/p'
-case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
-*datarootdir*) ac_datarootdir_seen=yes;;
-*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
-  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
-$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-  ac_datarootdir_hack='
-  s&@datadir@&$datadir&g
-  s&@docdir@&$docdir&g
-  s&@infodir@&$infodir&g
-  s&@localedir@&$localedir&g
-  s&@mandir@&$mandir&g
-  s&\\\${datarootdir}&$datarootdir&g' ;;
-esac
-_ACEOF
-
-# Neutralize VPATH when `$srcdir' = `.'.
-# Shell code in configure.ac might set extrasub.
-# FIXME: do we really want to maintain this feature?
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-ac_sed_extra="$ac_vpsub
-$extrasub
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-:t
-/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
-s|@configure_input@|$ac_sed_conf_input|;t t
-s&@top_builddir@&$ac_top_builddir_sub&;t t
-s&@top_build_prefix@&$ac_top_build_prefix&;t t
-s&@srcdir@&$ac_srcdir&;t t
-s&@abs_srcdir@&$ac_abs_srcdir&;t t
-s&@top_srcdir@&$ac_top_srcdir&;t t
-s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
-s&@builddir@&$ac_builddir&;t t
-s&@abs_builddir@&$ac_abs_builddir&;t t
-s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
-s&@INSTALL@&$ac_INSTALL&;t t
-$ac_datarootdir_hack
-"
-eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
-  >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
-
-test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
-  { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
-  { ac_out=`sed -n '/^[	 ]*datarootdir[	 ]*:*=/p' \
-      "$ac_tmp/out"`; test -z "$ac_out"; } &&
-  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-which seems to be undefined.  Please make sure it is defined" >&5
-$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-which seems to be undefined.  Please make sure it is defined" >&2;}
-
-  rm -f "$ac_tmp/stdin"
-  case $ac_file in
-  -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
-  *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
-  esac \
-  || as_fn_error $? "could not create $ac_file" "$LINENO" 5
- ;;
-  :H)
-  #
-  # CONFIG_HEADER
-  #
-  if test x"$ac_file" != x-; then
-    {
-      $as_echo "/* $configure_input  */" \
-      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
-    } >"$ac_tmp/config.h" \
-      || as_fn_error $? "could not create $ac_file" "$LINENO" 5
-    if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
-$as_echo "$as_me: $ac_file is unchanged" >&6;}
-    else
-      rm -f "$ac_file"
-      mv "$ac_tmp/config.h" "$ac_file" \
-	|| as_fn_error $? "could not create $ac_file" "$LINENO" 5
-    fi
-  else
-    $as_echo "/* $configure_input  */" \
-      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
-      || as_fn_error $? "could not create -" "$LINENO" 5
-  fi
- ;;
-
-
-  esac
-
-done # for ac_tag
-
-
-as_fn_exit 0
-_ACEOF
-ac_clean_files=$ac_clean_files_save
-
-test $ac_write_fail = 0 ||
-  as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
-
-
-# configure is writing to config.log, and then calls config.status.
-# config.status does its own redirection, appending to config.log.
-# Unfortunately, on DOS this fails, as config.log is still kept open
-# by configure, so config.status won't be able to write to it; its
-# output is simply discarded.  So we exec the FD to /dev/null,
-# effectively closing config.log, so it can be properly (re)opened and
-# appended to by config.status.  When coming back to configure, we
-# need to make the FD available again.
-if test "$no_create" != yes; then
-  ac_cs_success=:
-  ac_config_status_args=
-  test "$silent" = yes &&
-    ac_config_status_args="$ac_config_status_args --quiet"
-  exec 5>/dev/null
-  $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
-  exec 5>>config.log
-  # Use ||, not &&, to avoid exiting from the if with $? = 1, which
-  # would make configure fail if this is the last instruction.
-  $ac_cs_success || as_fn_exit 1
-fi
-if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
-$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
-fi
-
-
-if test -n "$no_x" -o "x$smr_have_Xm_library" != xyes -o "x$smr_have_freetype2_library" != xyes; then
-  if test -n "$no_x"; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Couldn't find X" >&5
-$as_echo "$as_me: WARNING: Couldn't find X" >&2;};
-  fi
-  if test "x$smr_have_Xm_library" != xyes; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Couldn't find Motif" >&5
-$as_echo "$as_me: WARNING: Couldn't find Motif" >&2;};
-  fi
-  if test "x$smr_have_freetype2_library" != xyes; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Couldn't find FreeType" >&5
-$as_echo "$as_me: WARNING: Couldn't find FreeType" >&2;};
-  fi
-  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: -- You will be able to compile pdftops, pdftotext,
-        pdfinfo, pdffonts, pdfdetach, and pdfimages, but not xpdf
-        or pdftoppm" >&5
-$as_echo "$as_me: WARNING: -- You will be able to compile pdftops, pdftotext,
-        pdfinfo, pdffonts, pdfdetach, and pdfimages, but not xpdf
-        or pdftoppm" >&2;}
-fi
-
-if test "x$smr_have_libpng_library" != xyes; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Couldn't find libpng -- you will not be able to build pdftohtml or pdftopng" >&5
-$as_echo "$as_me: WARNING: Couldn't find libpng -- you will not be able to build pdftohtml or pdftopng" >&2;}
-fi

Deleted: branches/stable/source/src/libs/xpdf/xpdf-src/configure.in
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/configure.in	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/configure.in	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,398 +0,0 @@
-dnl Process this file with autoconf to produce a configure script.
-dnl Copyright 1998-2013 Glyph & Cog, LLC
-
-AC_PREREQ(2.57)
-
-AC_INIT(xpdf/Gfx.cc)
-AC_CONFIG_HEADER(aconf.h)
-
-dnl ##### Optional features.
-
-AC_ARG_ENABLE([a4-paper],
-  AS_HELP_STRING([--enable-a4-paper],
-                 [use A4 paper size instead of Letter for PostScript output]))
-AS_IF([test "x$enable_a4_paper" = "xyes"],
-      [AC_DEFINE(A4_PAPER)])
-
-AC_ARG_ENABLE([no-text-select],
-  AS_HELP_STRING([--enable-no-text-select],
-                 [do not allow text selection]))
-AS_IF([test "x$enable_no_text_select" = "xyes"],
-      [AC_DEFINE(NO_TEXT_SELECT)])
-
-AC_ARG_ENABLE([opi],
-  AS_HELP_STRING([--enable-opi],
-                 [include support for OPI comments]))
-AS_IF([test "x$enable_opi" = "xyes"],
-      [AC_DEFINE(OPI_SUPPORT)])
-
-AC_ARG_ENABLE([multithreaded],
-  AS_HELP_STRING([--enable-multithreaded],
-                 [include support for multithreading]))
-AS_IF([test "x$enable_multithreaded" = "xyes"],
-      [AC_DEFINE(MULTITHREADED)])
-
-AC_ARG_ENABLE([exceptions],
-  AS_HELP_STRING([--enable-exceptions],
-                 [use C++ exceptions]))
-AS_IF([test "x$enable_exceptions" = "xyes"],
-      [AC_DEFINE(USE_EXCEPTIONS)])
-
-AC_ARG_ENABLE([fixedpoint],
-  AS_HELP_STRING([--enable-fixedpoint],
-                 [use fixed point (instead of floating point) arithmetic]))
-AS_IF([test "x$enable_fixedpoint" = "xyes"],
-      [AC_DEFINE(USE_FIXEDPOINT)])
-
-AC_ARG_ENABLE([cmyk],
-  AS_HELP_STRING([--enable-cmyk],
-                 [include support for CMYK rasterization]))
-AS_IF([test "x$enable_cmyk" = "xyes"],
-      [AC_DEFINE(SPLASH_CMYK)])
-
-AC_ARG_WITH([appdef-dir],
-  AS_HELP_STRING([--with-appdef-dir],
-                 [set app-defaults directory]))
-AS_IF([test "x$with_appdef_dir" != "xno"],
-      [AC_DEFINE_UNQUOTED(APPDEFDIR, "$with_appdef_dir")])
-
-dnl ##### Path to xpdfrc.
-dnl This ugly kludge to get the sysconfdir path is needed because
-dnl autoconf doesn't actually set the prefix variable until later.
-if test "$sysconfdir" = '${prefix}/etc'; then
-  if test "x$prefix" = xNONE; then
-    system_xpdfrc="$ac_default_prefix/etc/xpdfrc"
-  else
-    system_xpdfrc="$prefix/etc/xpdfrc"
-  fi
-else
-  system_xpdfrc="$sysconfdir/xpdfrc"
-fi
-AC_DEFINE_UNQUOTED(SYSTEM_XPDFRC, "$system_xpdfrc")
-
-dnl ##### Checks for programs.
-AC_PROG_CC
-AC_ISC_POSIX
-AC_PROG_CC_STDC
-#if test -z "$CXX" -a "$CC" = "gcc"; then
-#  CXX="gcc"
-#fi
-AC_PROG_CXX
-AC_PROG_INSTALL
-AC_PROG_RANLIB
-
-dnl ##### Default values for Unix.
-EXE=""
-LIBPREFIX="lib"
-AR="ar rc"
-UP_DIR=""
-
-dnl ##### Check for OS/2.
-AC_CACHE_CHECK([for OS/2 (with EMX)],
-xpdf_cv_sys_os2,
-[AC_TRY_COMPILE([],
-[__EMX__],
-xpdf_cv_sys_os2=yes, xpdf_cv_sys_os2=no)])
-if test "$xpdf_cv_sys_os2" = yes; then
-  EXE=".exe"
-  LIBPREFIX=""
-  AR="ar -rc"
-fi
-
-dnl ##### Check for DOS (with DJGPP).
-AC_CACHE_CHECK([for DOS (with DJGPP)],
-xpdf_cv_sys_dos,
-[AC_TRY_COMPILE([],
-[__DJGPP__],
-xpdf_cv_sys_dos=yes, xpdf_cv_sys_dos=no)])
-if test "$xpdf_cv_sys_dos" = yes; then
-  EXE=".exe"
-  LIBPREFIX="lib"
-  AR="ar -rc"
-  UP_DIR="../"
-fi
-
-dnl ##### Do substitutions.
-AC_SUBST(EXE)
-AC_SUBST(LIBPREFIX)
-AC_SUBST(AR)
-AC_SUBST(UP_DIR)
-
-dnl ##### Checks for header files.
-AC_PATH_XTRA
-AC_HEADER_DIRENT
-
-dnl ##### Switch over to C++.  This will make the checks below a little
-dnl ##### bit stricter (requiring function prototypes in include files).
-dnl ##### (99% of xpdf is written in C++.)
-AC_LANG_CPLUSPLUS
-
-dnl ##### Check for extra libraries needed by X.  (LynxOS needs this.)
-AC_CHECK_FUNC(gethostbyname)
-if test $ac_cv_func_gethostbyname = no; then
-  AC_CHECK_LIB(bsd, gethostbyname, X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd")
-fi
-
-dnl ##### Look for header that defines select() and fd_set.
-AC_MSG_CHECKING([select() and fd_set in sys/select.h and sys/bsdtypes.h])
-AC_TRY_COMPILE([#include <stdlib.h>
-#include <stddef.h>
-#include <unistd.h>
-#include <sys/types.h>],
-  [fd_set fds;
-select(0, NULL, NULL, NULL, NULL);], xpdf_ok=yes, xpdf_ok=no)
-if test $xpdf_ok = yes; then
-  AC_MSG_RESULT([not needed])
-else
-  AC_TRY_COMPILE([#include <stdlib.h>
-#include <stddef.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/select.h>],
-    [fd_set fds;
-select(0, NULL, NULL, NULL, NULL);], xpdf_ok=yes, xpdf_ok=no)
-  if test $xpdf_ok = yes; then
-    AC_DEFINE(HAVE_SYS_SELECT_H)
-    AC_MSG_RESULT([need sys/select.h])
-  else
-    AC_TRY_COMPILE([#include <stdlib.h>
-#include <stddef.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/bsdtypes.h>],
-      [fd_set fds;
-select(0, NULL, NULL, NULL, NULL);], xpdf_ok=yes, xpdf_ok=no)
-    if test $xpdf_ok = yes; then
-      AC_DEFINE(HAVE_SYS_BSDTYPES_H)
-      AC_MSG_RESULT([need sys/bsdtypes.h])
-    else
-      AC_MSG_RESULT([problem])
-    fi
-  fi
-fi
-
-dnl ##### Look for header that defines FD_ZERO.
-AC_MSG_CHECKING([FD_ZERO and strings.h or bstring.h])
-AC_TRY_COMPILE([#include <stdlib.h>
-#include <sys/types.h>
-#ifdef HAVE_SYS_SELECT_H
-#include <sys/select.h>
-#endif],
-[fd_set fds; FD_ZERO(&fds);], xpdf_ok=yes, xpdf_ok=no)
-if test $xpdf_ok = yes; then
-  AC_MSG_RESULT([not needed])
-else
-  AC_TRY_COMPILE([#include <stdlib.h>
-#include <sys/types.h>
-#include <strings.h>
-#ifdef HAVE_SYS_SELECT_H
-#include <sys/select.h>
-#endif],
-    [fd_set fds; FD_ZERO(&fds);], xpdf_ok=yes, xpdf_ok=no)
-  if test $xpdf_ok = yes; then
-    AC_DEFINE(HAVE_STRINGS_H)
-    AC_MSG_RESULT([need strings.h])
-  else
-    AC_TRY_COMPILE([#include <stdlib.h>
-#include <sys/types.h>
-#include <bstring.h>
-#ifdef HAVE_SYS_SELECT_H
-#include <sys/select.h>
-#endif],
-      [fd_set fds; FD_ZERO(&fds);], xpdf_ok=yes, xpdf_ok=no)
-    if test $xpdf_ok = yes; then
-      AC_DEFINE(HAVE_BSTRING_H)
-      AC_MSG_RESULT([need bstring.h])
-    else
-      AC_MSG_RESULT([problem])
-    fi
-  fi
-fi
-
-dnl ##### Look for rewinddir.
-AC_CHECK_FUNCS(rewinddir)
-if test $ac_cv_func_rewinddir = no; then
-  AC_CHECK_LIB(cposix, rewinddir)
-fi
-
-dnl ##### Checks for library functions.
-AC_CHECK_FUNCS(popen)
-dnl # This should use 'AC_CHECK_FUNCS(mkstemp)' but that fails if
-dnl # the mkstemp exists in the library but isn't declared in the
-dnl # include file (e.g., in cygwin 1.1.2).
-AC_CACHE_CHECK([for mkstemp],
-xpdf_cv_func_mkstemp,
-[AC_TRY_LINK([#include <stdlib.h>
-#include <unistd.h>],
-[mkstemp("foo");],
-xpdf_cv_func_mkstemp=yes, xpdf_cv_func_mkstemp=no)])
-if test "$xpdf_cv_func_mkstemp" = yes; then
-  AC_DEFINE(HAVE_MKSTEMP)
-fi
-dnl # Check for mkstemps, just like mkstemp.
-AC_CACHE_CHECK([for mkstemps],
-xpdf_cv_func_mkstemps,
-[AC_TRY_LINK([#include <stdlib.h>
-#include <unistd.h>],
-[mkstemps("foo", 0);],
-xpdf_cv_func_mkstemps=yes, xpdf_cv_func_mkstemps=no)])
-if test "$xpdf_cv_func_mkstemps" = yes; then
-  AC_DEFINE(HAVE_MKSTEMPS)
-fi
-
-dnl ##### Check select argument type: on HP-UX before version 10, select
-dnl ##### takes (int *) instead of (fd_set *).
-AC_CACHE_CHECK([whether select takes fd_set arguments],
-xpdf_cv_func_select_arg,
-[AC_TRY_COMPILE([#include <sys/types.h>
-#include <sys/time.h>
-#include <unistd.h>
-#ifdef HAVE_SYS_SELECT_H
-#include <sys/select.h>
-#endif],
-[fd_set fds;
-select(1, &fds, &fds, &fds, 0);],
-xpdf_cv_func_select_arg=yes, xpdf_cv_func_select_arg=no)])
-if test "$xpdf_cv_func_select_arg" != yes; then
-  AC_DEFINE(SELECT_TAKES_INT)
-fi
-
-dnl ##### Check for std::sort.
-AC_CACHE_CHECK([for std::sort],
-xpdf_cv_func_std_sort,
-[AC_COMPILE_IFELSE(
-  [AC_LANG_PROGRAM([[#include <algorithm>
-struct functor {
-  bool operator()(const int &i0, const int &i1) { return i0 < i1; }
-};]],
-                  [[int a[100];
-std::sort(a, a+100, functor());]])],
-xpdf_cv_func_std_sort=yes, xpdf_cv_func_std_sort=no)])
-if test "$xpdf_cv_func_std_sort" = yes; then
-  AC_DEFINE(HAVE_STD_SORT)
-fi
-
-dnl ##### Back to C for the library tests.
-AC_LANG_C
-
-dnl ##### Check for fseeko/ftello or fseek64/ftell64
-dnl The LARGEFILE and FSEEKO macros have to be called in C, not C++, mode.
-AC_SYS_LARGEFILE
-AC_FUNC_FSEEKO
-AC_CHECK_FUNCS(fseek64, xpdf_cv_func_fseek64=yes, xpdf_cv_func_fseek64=no)
-AC_CHECK_FUNCS(ftell64, xpdf_cv_func_ftell64=yes, xpdf_cv_func_ftell64=no)
-if test "$xpdf_cv_func_fseek64" = yes -a "$xpdf_cv_func_ftell64" = yes; then
-  AC_DEFINE(HAVE_FSEEK64)
-fi
-
-dnl ##### Check for libXpm.
-if test -z "$no_x"; then
-  smr_CHECK_LIB(Xpm, Xpm, [pixmap library - used only for icon], 
-                XpmCreatePixmapFromData, X11/xpm.h,
-                $X_LIBS $X_PRE_LIBS $X_EXTRA_LIBS -lX11, $X_CFLAGS)
-  AC_SUBST(Xpm_LIBS)
-  AC_SUBST(Xpm_CFLAGS)
-fi
-
-dnl ##### Check for Motif (libXm).
-if test -z "$no_x"; then
-  dnl # XextAddDisplay isn't defined in any header file, so we provide a
-  dnl # bogus prototype (so the compiler doesn't complain) and a bogus
-  dnl # header file (so the smr macro doesn't break).
-  smr_CHECK_LIB(Xext, Xext, [Motif library], 
-                XextAddDisplay, X11/Xlib.h,
-                $X_LIBS $X_PRE_LIBS $X_EXTRA_LIBS -lX11, $X_CFLAGS,
-                [int XextAddDisplay();])
-  AC_SUBST(Xext_LIBS)
-  AC_SUBST(Xext_CFLAGS)
-  smr_CHECK_LIB(Xp, Xp, [Motif library], 
-                XpStartPage, X11/extensions/Print.h,
-                $X_LIBS $X_PRE_LIBS $Xext_LIBS $X_EXTRA_LIBS -lX11, $X_CFLAGS)
-  AC_SUBST(Xp_LIBS)
-  AC_SUBST(Xp_CFLAGS)
-  smr_CHECK_LIB(Xt, Xt, [Motif library], 
-                XtAppInitialize, X11/Intrinsic.h,
-                $X_LIBS $X_PRE_LIBS $X_EXTRA_LIBS -lX11, $X_CFLAGS)
-  AC_SUBST(Xt_LIBS)
-  AC_SUBST(Xt_CFLAGS)
-  smr_CHECK_LIB(Xm, Xm, [Motif library], 
-                XmCreateForm, Xm/XmAll.h,
-                $Xt_LIBS $X_LIBS $X_PRE_LIBS $Xp_LIBS $Xext_LIBS $X_EXTRA_LIBS -lX11, $X_CFLAGS)
-  AC_SUBST(Xm_LIBS)
-  AC_SUBST(Xm_CFLAGS)
-  smr_CHECK_LIB(Sgm, Sgm, [SGI Motif library],
-                SgCreateHorzPanedWindow, Sgm/HPanedW.h,
-                $Xm_LIBS $Xt_LIBS $X_LIBS $X_PRE_LIBS $Xp_LIBS $Xext_LIBS $X_EXTRA_LIBS -lX11, $X_CFLAGS)
-  AC_SUBST(Sgm_LIBS)
-  AC_SUBST(Sgm_CFLAGS)
-
-  dnl # check for XtAppSetExitFlag, which didn't exist prior to X11R6 (?)
-  if test "x$smr_have_Xt_library" = xyes; then
-    AC_CHECK_LIB(Xt, XtAppSetExitFlag,
-		 AC_DEFINE(HAVE_XTAPPSETEXITFLAG), ,
-                 [$Xt_LIBS $X_LIBS $X_PRE_LIBS $Xp_LIBS $Xext_LIBS $X_EXTRA_LIBS -lX11])
-  fi
-fi
-
-dnl ##### Check for FreeType 2.x.
-dnl ##### (Note: FT_Get_Name_Index was added in FT 2.0.5, and is
-dnl ##### the reason that Xpdf requires 2.0.5+.)
-smr_CHECK_LIB(freetype2, freetype, [FreeType2 font rasterizer - version 2.0.5+],
-              FT_Get_Name_Index, ft2build.h, -lm)
-AC_SUBST(freetype2_LIBS)
-AC_SUBST(freetype2_CFLAGS)
-if test "x$smr_have_freetype2_library" = xyes; then
-  AC_DEFINE(HAVE_FREETYPE_FREETYPE_H)
-  AC_DEFINE(HAVE_SPLASH)
-fi
-
-dnl ##### Check for libpng.
-smr_CHECK_LIB(libpng, png, [PNG library], png_write_row, png.h, -lz)
-AC_SUBST(libpng_LIBS)
-AC_SUBST(libpng_CFLAGS)
-
-dnl ##### Check for libpaper (Debian).
-smr_CHECK_LIB(libpaper, paper, [Debian libpaper], paperinit, paper.h)
-AC_SUBST(libpaper_LIBS)
-AC_SUBST(libpaper_CFLAGS)
-
-dnl ##### Disable X-specific stuff in top-level Makefile.
-if test -n "$no_x" -o "x$smr_have_Xm_library" != xyes -o "x$smr_have_freetype2_library" != xyes; then
-  X="#"
-  XPDF_TARGET="all-no-x"
-else
-  X=""
-  XPDF_TARGET="all"
-fi
-AC_SUBST(X)
-AC_SUBST(XPDF_TARGET)
-
-dnl ##### Extra libraries.
-EXTRA_LIBS=
-EXTRA_CFLAGS=
-AC_SUBST(EXTRA_LIBS)
-AC_SUBST(EXTRA_CFLAGS)
-
-dnl ##### Write the makefiles.
-AC_OUTPUT(Makefile goo/Makefile fofi/Makefile splash/Makefile xpdf/Makefile)
-
-dnl ##### Warn user if X is missing.
-if test -n "$no_x" -o "x$smr_have_Xm_library" != xyes -o "x$smr_have_freetype2_library" != xyes; then
-  if test -n "$no_x"; then
-    AC_MSG_WARN([Couldn't find X]);
-  fi
-  if test "x$smr_have_Xm_library" != xyes; then
-    AC_MSG_WARN([Couldn't find Motif]);
-  fi
-  if test "x$smr_have_freetype2_library" != xyes; then
-    AC_MSG_WARN([Couldn't find FreeType]);
-  fi
-  AC_MSG_WARN([-- You will be able to compile pdftops, pdftotext,
-        pdfinfo, pdffonts, pdfdetach, and pdfimages, but not xpdf
-        or pdftoppm])
-fi
-
-dnl ##### Warn user if libpng is missing.
-if test "x$smr_have_libpng_library" != xyes; then
-  AC_MSG_WARN([Couldn't find libpng -- you will not be able to build pdftohtml or pdftopng])
-fi

Deleted: branches/stable/source/src/libs/xpdf/xpdf-src/dj_make.bat
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/dj_make.bat	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/dj_make.bat	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,91 +0,0 @@
-set CC=gcc
-set CFLAGS=-g -O2 -I.. -I..\splash -I..\fofi -I..\goo
-set CXX=gpp
-set CXXFLAGS=%CFLAGS%
-set LIBPROG=ar
-
-copy aconf-dj.h aconf.h
-
-cd goo
-%CXX% %CXXFLAGS% -c GHash.cc
-%CXX% %CXXFLAGS% -c GList.cc
-%CXX% %CXXFLAGS% -c GString.cc
-%CXX% %CXXFLAGS% -c gmem.cc
-%CXX% %CXXFLAGS% -c gmempp.cc
-%CXX% %CXXFLAGS% -c gfile.cc
-%CC% %CFLAGS% -c parseargs.c
-del libGoo.a
-%LIBPROG% -rc libGoo.a GHash.o GList.o GString.o gmempp.o gfile.o gmem.o parseargs.o
-
-cd ..\fofi
-%CXX% %CXXFLAGS% -c FoFiBase.cc
-%CXX% %CXXFLAGS% -c FoFiEncodings.cc
-%CXX% %CXXFLAGS% -c FoFiIdentifier.cc
-%CXX% %CXXFLAGS% -c FoFiTrueType.cc
-%CXX% %CXXFLAGS% -c FoFiType1.cc
-%CXX% %CXXFLAGS% -c FoFiType1C.cc
-%LIBPROG% -rc libfofi.a FoFiBase.o FoFiEncodings.o FoFiIdentifier.o FoFiTrueType.o FoFiType1.o FoFiType1C.o
-
-cd ..\xpdf
-del *.o
-%CXX% %CXXFLAGS% -c AcroForm.cc
-%CXX% %CXXFLAGS% -c Annot.cc
-%CXX% %CXXFLAGS% -c Array.cc
-%CXX% %CXXFLAGS% -c BuiltinFont.cc
-%CXX% %CXXFLAGS% -c BuiltinFontTables.cc
-%CXX% %CXXFLAGS% -c CMap.cc
-%CXX% %CXXFLAGS% -c Catalog.cc
-%CXX% %CXXFLAGS% -c CharCodeToUnicode.cc
-%CXX% %CXXFLAGS% -c Decrypt.cc
-%CXX% %CXXFLAGS% -c Dict.cc
-%CXX% %CXXFLAGS% -c Error.cc
-%CXX% %CXXFLAGS% -c FontEncodingTables.cc
-%CXX% %CXXFLAGS% -c Form.cc
-%CXX% %CXXFLAGS% -c Function.cc
-%CXX% %CXXFLAGS% -c Gfx.cc
-%CXX% %CXXFLAGS% -c GfxFont.cc
-%CXX% %CXXFLAGS% -c GfxState.cc
-%CXX% %CXXFLAGS% -c GlobalParams.cc
-%CXX% %CXXFLAGS% -c ImageOutputDev.cc
-%CXX% %CXXFLAGS% -c JArithmeticDecoder.cc
-%CXX% %CXXFLAGS% -c JBIG2Stream.cc
-%CXX% %CXXFLAGS% -c JPXStream.cc
-%CXX% %CXXFLAGS% -c Lexer.cc
-%CXX% %CXXFLAGS% -c Link.cc
-%CXX% %CXXFLAGS% -c NameToCharCode.cc
-%CXX% %CXXFLAGS% -c Object.cc
-%CXX% %CXXFLAGS% -c OptionalContent.cc
-%CXX% %CXXFLAGS% -c Outline.cc
-%CXX% %CXXFLAGS% -c OutputDev.cc
-%CXX% %CXXFLAGS% -c PDFDoc.cc
-%CXX% %CXXFLAGS% -c PDFDocEncoding.cc
-%CXX% %CXXFLAGS% -c PSOutputDev.cc
-%CXX% %CXXFLAGS% -c PSTokenizer.cc
-%CXX% %CXXFLAGS% -c Page.cc
-%CXX% %CXXFLAGS% -c Parser.cc
-%CXX% %CXXFLAGS% -c PreScanOutputDev.cc
-%CXX% %CXXFLAGS% -c SecurityHandler.cc
-%CXX% %CXXFLAGS% -c Stream.cc
-%CXX% %CXXFLAGS% -c TextOutputDev.cc
-%CXX% %CXXFLAGS% -c TextString.cc
-%CXX% %CXXFLAGS% -c UnicodeMap.cc
-%CXX% %CXXFLAGS% -c UnicodeTypeTable.cc
-%CXX% %CXXFLAGS% -c XFAForm.cc
-%CXX% %CXXFLAGS% -c XRef.cc
-%CXX% %CXXFLAGS% -c Zoox.cc
-del libxpdf.a
-%LIBPROG% -rc libxpdf.a *.o
-
-%CXX% %CXXFLAGS% -o pdftops.exe pdftops.cc libxpdf.a ..\fofi\libfofi.a ..\goo\libGoo.a
-
-%CXX% %CXXFLAGS% -o pdftotext.exe pdftotext.cc libxpdf.a ..\fofi\libfofi.a ..\goo\libGoo.a
-
-%CXX% %CXXFLAGS% -o pdfinfo.exe pdfinfo.cc libxpdf.a ..\fofi\libfofi.a ..\goo\libGoo.a
-
-%CXX% %CXXFLAGS% -o pdffonts.exe pdffonts.cc libxpdf.a ..\fofi\libfofi.a ..\goo\libGoo.a
-
-%CXX% %CXXFLAGS% -o pdfdetach.exe pdfdetach.cc libxpdf.a ..\fofi\libfofi.a ..\goo\libGoo.a
-
-%CXX% %CXXFLAGS% -o pdfimages.exe pdfimages.cc libxpdf.a ..\fofi\libfofi.a ..\goo\libGoo.a
-
-cd ..

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdfdetach.1
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdfdetach.1	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdfdetach.1	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,8 +1,8 @@
-.\" Copyright 2013-2014 Glyph & Cog, LLC
-.TH pdfdetach 1 "28 May 2014"
+.\" Copyright 2013-2017 Glyph & Cog, LLC
+.TH pdfdetach 1 "10 Aug 2017"
 .SH NAME
 pdfdetach \- Portable Document Format (PDF) document embedded file
-extractor (version 3.04)
+extractor (version 4.00)
 .SH SYNOPSIS
 .B pdfdetach
 [options]
@@ -90,7 +90,7 @@
 99
 Other error.
 .SH AUTHOR
-The pdfinfo software and documentation are copyright 1996-2014 Glyph &
+The pdfinfo software and documentation are copyright 1996-2017 Glyph &
 Cog, LLC.
 .SH "SEE ALSO"
 .BR xpdf (1),
@@ -104,4 +104,4 @@
 .BR pdfimages (1),
 .BR xpdfrc (5)
 .br
-.B http://www.foolabs.com/xpdf/
+.B http://www.xpdfreader.com/

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdfdetach.cat
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdfdetach.cat	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdfdetach.cat	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,10 +1,10 @@
-pdfdetach(1)                                                      pdfdetach(1)
+pdfdetach(1)                General Commands Manual               pdfdetach(1)
 
 
 
 NAME
        pdfdetach  -  Portable  Document  Format  (PDF)  document embedded file
-       extractor (version 3.04)
+       extractor (version 4.00)
 
 SYNOPSIS
        pdfdetach [options] [PDF-file]
@@ -79,14 +79,14 @@
        99     Other error.
 
 AUTHOR
-       The pdfinfo software and documentation are copyright 1996-2014 Glyph  &
+       The pdfinfo software and documentation are copyright 1996-2017 Glyph  &
        Cog, LLC.
 
 SEE ALSO
        xpdf(1),   pdftops(1),  pdftotext(1),  pdftohtml(1),  pdfinfo(1),  pdf-
        fonts(1), pdftoppm(1), pdftopng(1), pdfimages(1), xpdfrc(5)
-       http://www.foolabs.com/xpdf/
+       http://www.xpdfreader.com/
 
 
 
-                                  28 May 2014                     pdfdetach(1)
+                                  10 Aug 2017                     pdfdetach(1)

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdffonts.1
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdffonts.1	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdffonts.1	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,8 +1,8 @@
-.\" Copyright 1999-2014 Glyph & Cog, LLC
-.TH pdffonts 1 "28 May 2014"
+.\" Copyright 1999-2017 Glyph & Cog, LLC
+.TH pdffonts 1 "10 Aug 2017"
 .SH NAME
 pdffonts \- Portable Document Format (PDF) font analyzer (version
-3.04)
+4.00)
 .SH SYNOPSIS
 .B pdffonts
 [options]
@@ -32,6 +32,10 @@
 absence of a ToUnicode map doesn't necessarily mean that the text
 can't be converted to Unicode)
 .TP
+.B prob
+"X" if this font is likely to be problematic when converting text to
+Unicode
+.TP
 .B object ID
 the font dictionary object ID (number and generation)
 .TP
@@ -143,7 +147,7 @@
 99
 Other error.
 .SH AUTHOR
-The pdffonts software and documentation are copyright 1996-2014 Glyph
+The pdffonts software and documentation are copyright 1996-2017 Glyph
 & Cog, LLC.
 .SH "SEE ALSO"
 .BR xpdf (1),
@@ -157,4 +161,4 @@
 .BR pdfimages (1),
 .BR xpdfrc (5)
 .br
-.B http://www.foolabs.com/xpdf/
+.B http://www.xpdfreader.com/

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdffonts.cat
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdffonts.cat	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdffonts.cat	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,9 +1,9 @@
-pdffonts(1)                                                        pdffonts(1)
+pdffonts(1)                 General Commands Manual                pdffonts(1)
 
 
 
 NAME
-       pdffonts - Portable Document Format (PDF) font analyzer (version 3.04)
+       pdffonts - Portable Document Format (PDF) font analyzer (version 4.00)
 
 SYNOPSIS
        pdffonts [options] [PDF-file]
@@ -27,6 +27,9 @@
               (the absence of a ToUnicode map doesn't  necessarily  mean  that
               the text can't be converted to Unicode)
 
+       prob   "X"  if  this  font  is likely to be problematic when converting
+              text to Unicode
+
        object ID
               the font dictionary object ID (number and generation)
 
@@ -49,13 +52,13 @@
 
 CONFIGURATION FILE
        Pdffonts reads a configuration file at startup.  It first tries to find
-       the user's private config file, ~/.xpdfrc.  If that doesn't  exist,  it
-       looks  for  a  system-wide config file, typically /usr/local/etc/xpdfrc
-       (but this location can be changed when pdffonts  is  built).   See  the
+       the  user's  private config file, ~/.xpdfrc.  If that doesn't exist, it
+       looks for a system-wide config  file,  typically  /usr/local/etc/xpdfrc
+       (but  this  location  can  be changed when pdffonts is built).  See the
        xpdfrc(5) man page for details.
 
 OPTIONS
-       Many  of  the following options can be set with configuration file com-
+       Many of the following options can be set with configuration  file  com-
        mands.  These are listed in square brackets with the description of the
        corresponding command line option.
 
@@ -62,12 +65,12 @@
        -f number
               Specifies the first page to analyze.
 
-       -loc   Shows  additional  information  on the location of the font that
-              will be used  when  the  PDF  file  is  rasterized  (with  xpdf,
+       -loc   Shows additional information on the location of  the  font  that
+              will  be  used  when  the  PDF  file  is  rasterized (with xpdf,
               pdftoppm, etc.).
 
-       -locPS Shows  additional  information  on the location of the font that
-              will be used when the PDF file is converted to PostScript  (with
+       -locPS Shows additional information on the location of  the  font  that
+              will  be used when the PDF file is converted to PostScript (with
               pdftops).
 
        -l number
@@ -74,7 +77,7 @@
               Specifies the last page to analyze.
 
        -opw password
-              Specify  the  owner  password  for the PDF file.  Providing this
+              Specify the owner password for the  PDF  file.   Providing  this
               will bypass all security restrictions.
 
        -upw password
@@ -102,14 +105,14 @@
        99     Other error.
 
 AUTHOR
-       The pdffonts software and documentation are copyright 1996-2014 Glyph &
+       The pdffonts software and documentation are copyright 1996-2017 Glyph &
        Cog, LLC.
 
 SEE ALSO
-       xpdf(1), pdftops(1),  pdftotext(1),  pdftohtml(1),  pdfinfo(1),  pdfde-
+       xpdf(1),  pdftops(1),  pdftotext(1),  pdftohtml(1),  pdfinfo(1), pdfde-
        tach(1), pdftoppm(1), pdftopng(1), pdfimages(1), xpdfrc(5)
-       http://www.foolabs.com/xpdf/
+       http://www.xpdfreader.com/
 
 
 
-                                  28 May 2014                      pdffonts(1)
+                                  10 Aug 2017                      pdffonts(1)

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdfimages.1
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdfimages.1	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdfimages.1	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,8 +1,8 @@
-.\" Copyright 1998-2014 Glyph & Cog, LLC
-.TH pdfimages 1 "28 May 2014"
+.\" Copyright 1998-2017 Glyph & Cog, LLC
+.TH pdfimages 1 "10 Aug 2017"
 .SH NAME
 pdfimages \- Portable Document Format (PDF) image extractor
-(version 3.04)
+(version 4.00)
 .SH SYNOPSIS
 .B pdfimages
 [options]
@@ -10,17 +10,18 @@
 .SH DESCRIPTION
 .B Pdfimages
 saves images from a Portable Document Format (PDF) file as Portable
-Pixmap (PPM), Portable Bitmap (PBM), or JPEG files.
+Pixmap (PPM), Portable Graymap (PGM), Portable Bitmap (PBM), or JPEG
+files.
 .PP
 Pdfimages reads the PDF file, scans one or more pages,
 .IR PDF-file ,
-and writes one PPM, PBM, or JPEG file for each image,
+and writes one PPM, PGM, PBM, or JPEG file for each image,
 .IR image-root - nnnn . xxx ,
 where
 .I nnnn
 is the image number and
 .I xxx
-is the image type (.ppm, .pbm, .jpg).
+is the image type (.ppm, .pgm, .pbm, .jpg).
 .PP
 NB: pdfimages extracts the raw image data from the PDF file, without
 performing any additional transforms.  Any rotation, clipping,
@@ -45,11 +46,24 @@
 Specifies the last page to scan.
 .TP
 .B \-j
-Normally, all images are written as PBM (for monochrome images) or PPM
-(for non-monochrome images) files.  With this option, images in DCT
-format are saved as JPEG files.  All non-DCT images are saved in
-PBM/PPM format as usual.
+Normally, all images are written as PBM (for monochrome images), PGM
+(for grayscale images), or PPM (for color images) files.  With this
+option, images in DCT format are saved as JPEG files.  All non-DCT
+images are saved in PBM/PGM/PPM format as usual.  (Inline images are
+always saved in PBM/PGM/PPM format.)
 .TP
+.B \-raw
+Write all images in PDF-native formats.  Most of the formats are not
+standard image formats, so this option is primarily useful as input to
+a tool that generates PDF files.  (Inline images are always saved in
+PBM/PGM/PPM format.)
+.TP
+.B \-list
+Write a one-line summary to stdout for each image.  The summary
+provides the image file name, the page number, the image width and
+height, the horizontal and vertical resolution (DPI) as drawn, the
+color space type, and the number of bits per component (BPC).
+.TP
 .BI \-opw " password"
 Specify the owner password for the PDF file.  Providing this will
 bypass all security restrictions.
@@ -88,7 +102,7 @@
 99
 Other error.
 .SH AUTHOR
-The pdfimages software and documentation are copyright 1998-2014 Glyph
+The pdfimages software and documentation are copyright 1998-2017 Glyph
 & Cog, LLC.
 .SH "SEE ALSO"
 .BR xpdf (1),
@@ -102,4 +116,4 @@
 .BR pdftopng (1),
 .BR xpdfrc (5)
 .br
-.B http://www.foolabs.com/xpdf/
+.B http://www.xpdfreader.com/

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdfimages.cat
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdfimages.cat	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdfimages.cat	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,10 +1,10 @@
-pdfimages(1)                                                      pdfimages(1)
+pdfimages(1)                General Commands Manual               pdfimages(1)
 
 
 
 NAME
        pdfimages  -  Portable  Document  Format (PDF) image extractor (version
-       3.04)
+       4.00)
 
 SYNOPSIS
        pdfimages [options] PDF-file image-root
@@ -11,26 +11,27 @@
 
 DESCRIPTION
        Pdfimages saves images from a Portable Document Format  (PDF)  file  as
-       Portable Pixmap (PPM), Portable Bitmap (PBM), or JPEG files.
+       Portable  Pixmap  (PPM), Portable Graymap (PGM), Portable Bitmap (PBM),
+       or JPEG files.
 
-       Pdfimages  reads  the  PDF file, scans one or more pages, PDF-file, and
-       writes one PPM, PBM, or JPEG file for each image,  image-root-nnnn.xxx,
-       where  nnnn  is the image number and xxx is the image type (.ppm, .pbm,
-       .jpg).
+       Pdfimages reads the PDF file, scans one or more  pages,  PDF-file,  and
+       writes  one  PPM,  PGM,  PBM,  or JPEG file for each image, image-root-
+       nnnn.xxx, where nnnn is the image number and  xxx  is  the  image  type
+       (.ppm, .pgm, .pbm, .jpg).
 
-       NB: pdfimages extracts the raw image data from the  PDF  file,  without
-       performing  any  additional  transforms.  Any rotation, clipping, color
+       NB:  pdfimages  extracts  the raw image data from the PDF file, without
+       performing any additional transforms.  Any  rotation,  clipping,  color
        inversion, etc. done by the PDF content stream is ignored.
 
 CONFIGURATION FILE
-       Pdfimages reads a configuration file at startup.   It  first  tries  to
+       Pdfimages  reads  a  configuration  file at startup.  It first tries to
        find the user's private config file, ~/.xpdfrc.  If that doesn't exist,
        it looks for a system-wide config file, typically /usr/local/etc/xpdfrc
-       (but  this  location  can be changed when pdfimages is built).  See the
+       (but this location can be changed when pdfimages is  built).   See  the
        xpdfrc(5) man page for details.
 
 OPTIONS
-       Many of the following options can be set with configuration  file  com-
+       Many  of  the following options can be set with configuration file com-
        mands.  These are listed in square brackets with the description of the
        corresponding command line option.
 
@@ -40,13 +41,25 @@
        -l number
               Specifies the last page to scan.
 
-       -j     Normally, all images are written as PBM (for monochrome  images)
-              or  PPM  (for  non-monochrome  images) files.  With this option,
-              images in DCT format are  saved  as  JPEG  files.   All  non-DCT
-              images are saved in PBM/PPM format as usual.
+       -j     Normally, all images are written as PBM (for monochrome images),
+              PGM (for grayscale images), or PPM  (for  color  images)  files.
+              With  this option, images in DCT format are saved as JPEG files.
+              All non-DCT images are saved in  PBM/PGM/PPM  format  as  usual.
+              (Inline images are always saved in PBM/PGM/PPM format.)
 
+       -raw   Write all images in PDF-native formats.  Most of the formats are
+              not standard image formats, so this option is  primarily  useful
+              as input to a tool that generates PDF files.  (Inline images are
+              always saved in PBM/PGM/PPM format.)
+
+       -list  Write a one-line summary to stdout for each image.  The  summary
+              provides  the  image file name, the page number, the image width
+              and height, the horizontal  and  vertical  resolution  (DPI)  as
+              drawn,  the  color space type, and the number of bits per compo-
+              nent (BPC).
+
        -opw password
-              Specify  the  owner  password  for the PDF file.  Providing this
+              Specify the owner password for the  PDF  file.   Providing  this
               will bypass all security restrictions.
 
        -upw password
@@ -72,14 +85,14 @@
        99     Other error.
 
 AUTHOR
-       The pdfimages software and documentation are copyright 1998-2014  Glyph
+       The  pdfimages software and documentation are copyright 1998-2017 Glyph
        & Cog, LLC.
 
 SEE ALSO
-       xpdf(1),   pdftops(1),  pdftotext(1),  pdftohtml(1),  pdfinfo(1),  pdf-
+       xpdf(1),  pdftops(1),  pdftotext(1),  pdftohtml(1),  pdfinfo(1),   pdf-
        fonts(1), pdfdetach(1), pdftoppm(1), pdftopng(1), xpdfrc(5)
-       http://www.foolabs.com/xpdf/
+       http://www.xpdfreader.com/
 
 
 
-                                  28 May 2014                     pdfimages(1)
+                                  10 Aug 2017                     pdfimages(1)

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdfinfo.1
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdfinfo.1	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdfinfo.1	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,8 +1,8 @@
-.\" Copyright 1999-2014 Glyph & Cog, LLC
-.TH pdfinfo 1 "28 May 2014"
+.\" Copyright 1999-2017 Glyph & Cog, LLC
+.TH pdfinfo 1 "10 Aug 2017"
 .SH NAME
 pdfinfo \- Portable Document Format (PDF) document information
-extractor (version 3.04)
+extractor (version 4.00)
 .SH SYNOPSIS
 .B pdfinfo
 [options]
@@ -45,7 +45,7 @@
 tagged (yes/no)
 .RE
 .RS
-form (AcroForm / XFA / none)
+form (AcroForm / static XFA / dynamic XFA / none)
 .RE
 .RS
 page count
@@ -150,7 +150,7 @@
 99
 Other error.
 .SH AUTHOR
-The pdfinfo software and documentation are copyright 1996-2014 Glyph &
+The pdfinfo software and documentation are copyright 1996-2017 Glyph &
 Cog, LLC.
 .SH "SEE ALSO"
 .BR xpdf (1),
@@ -164,4 +164,4 @@
 .BR pdfimages (1),
 .BR xpdfrc (5)
 .br
-.B http://www.foolabs.com/xpdf/
+.B http://www.xpdfreader.com/

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdfinfo.cat
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdfinfo.cat	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdfinfo.cat	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,10 +1,10 @@
-pdfinfo(1)                                                          pdfinfo(1)
+pdfinfo(1)                  General Commands Manual                 pdfinfo(1)
 
 
 
 NAME
        pdfinfo - Portable Document Format (PDF) document information extractor
-       (version 3.04)
+       (version 4.00)
 
 SYNOPSIS
        pdfinfo [options] [PDF-file]
@@ -27,7 +27,7 @@
        In addition, the following information is printed:
 
               tagged (yes/no)
-              form (AcroForm / XFA / none)
+              form (AcroForm / static XFA / dynamic XFA / none)
               page count
               encrypted flag (yes/no)
               print and copy permissions (if encrypted)
@@ -104,14 +104,14 @@
        99     Other error.
 
 AUTHOR
-       The  pdfinfo software and documentation are copyright 1996-2014 Glyph &
+       The  pdfinfo software and documentation are copyright 1996-2017 Glyph &
        Cog, LLC.
 
 SEE ALSO
        xpdf(1), pdftops(1), pdftotext(1),  pdftohtml(1),  pdffonts(1),  pdfde-
        tach(1), pdftoppm(1), pdftopng(1), pdfimages(1), xpdfrc(5)
-       http://www.foolabs.com/xpdf/
+       http://www.xpdfreader.com/
 
 
 
-                                  28 May 2014                       pdfinfo(1)
+                                  10 Aug 2017                       pdfinfo(1)

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdftohtml.1
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdftohtml.1	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdftohtml.1	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,8 +1,8 @@
-.\" Copyright 1997-2014 Glyph & Cog, LLC
-.TH pdftohtml 1 "28 May 2014"
+.\" Copyright 1997-2017 Glyph & Cog, LLC
+.TH pdftohtml 1 "10 Aug 2017"
 .SH NAME
 pdftohtml \- Portable Document Format (PDF) to HTML converter
-(version 3.04)
+(version 4.00)
 .SH SYNOPSIS
 .B pdftohtml
 [options]
@@ -38,10 +38,30 @@
 .BI \-l " number"
 Specifies the last page to convert.
 .TP
-.B \-r
-Specifies the resolution, in DPI, for background images.  The default
-is 150 DPI.
+.BI \-z " number"
+Specifies the initial zoom level.  The default is 1.0, which means
+72dpi, i.e., 1 point in the PDF file will be 1 pixel in the HTML.
+Using \'-z 1.5', for example, will make the initial view 50% larger.
 .TP
+.BI \-r " number"
+Specifies the resolution, in DPI, for background images.  This
+controls the pixel size of the background image files.  The initial
+zoom level is controlled by the \'-z' option.  Specifying a larger
+\'-r' value will allow the viewer to zoom in farther without upscaling
+artifacts in the background.
+.TP
+.B \-skipinvisible
+Don't draw invisible text.  By default, invisible text (commonly used
+in OCR'ed PDF files) is drawn as transparent (alpha=0) HTML text.
+This option tells pdftohtml to discard invisible text entirely.
+.TP
+.B \-allinvisible
+Treat all text as invisible.  By default, regular (non-invisible) text
+is not drawn in the background image, and is instead drawn with HTML
+on top of the image.  This option tells pdftohtml to include the
+regular text in the background image, and then draw it as transparent
+(alpha=0) HTML text.
+.TP
 .BI \-opw " password"
 Specify the owner password for the PDF file.  Providing this will
 bypass all security restrictions.
@@ -89,7 +109,7 @@
 99
 Other error.
 .SH AUTHOR
-The pdftohtml software and documentation are copyright 1996-2014 Glyph
+The pdftohtml software and documentation are copyright 1996-2017 Glyph
 & Cog, LLC.
 .SH "SEE ALSO"
 .BR xpdf (1),
@@ -103,4 +123,4 @@
 .BR pdfimages (1),
 .BR xpdfrc (5)
 .br
-.B http://www.foolabs.com/xpdf/
+.B http://www.xpdfreader.com/

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdftohtml.cat
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdftohtml.cat	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdftohtml.cat	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,10 +1,10 @@
-pdftohtml(1)                                                      pdftohtml(1)
+pdftohtml(1)                General Commands Manual               pdftohtml(1)
 
 
 
 NAME
        pdftohtml  -  Portable Document Format (PDF) to HTML converter (version
-       3.04)
+       4.00)
 
 SYNOPSIS
        pdftohtml [options] PDF-file HTML-dir
@@ -35,11 +35,34 @@
        -l number
               Specifies the last page to convert.
 
-       -r     Specifies  the  resolution,  in DPI, for background images.  The
-              default is 150 DPI.
+       -z number
+              Specifies  the  initial  zoom  level.  The default is 1.0, which
+              means 72dpi, i.e., 1 point in the PDF file will be  1  pixel  in
+              the  HTML.   Using  '-z 1.5', for example, will make the initial
+              view 50% larger.
 
+       -r number
+              Specifies the resolution, in DPI, for background  images.   This
+              controls the pixel size of the background image files.  The ini-
+              tial zoom level is controlled by the '-z' option.  Specifying  a
+              larger '-r' value will allow the viewer to zoom in farther with-
+              out upscaling artifacts in the background.
+
+       -skipinvisible
+              Don't draw invisible text.  By default, invisible text (commonly
+              used in OCR'ed PDF files) is drawn as transparent (alpha=0) HTML
+              text.  This option tells pdftohtml  to  discard  invisible  text
+              entirely.
+
+       -allinvisible
+              Treat  all  text as invisible.  By default, regular (non-invisi-
+              ble) text is not drawn in the background image, and  is  instead
+              drawn  with  HTML on top of the image.  This option tells pdfto-
+              html to include the regular text in the  background  image,  and
+              then draw it as transparent (alpha=0) HTML text.
+
        -opw password
-              Specify the owner password for the  PDF  file.   Providing  this
+              Specify  the  owner  password  for the PDF file.  Providing this
               will bypass all security restrictions.
 
        -upw password
@@ -56,7 +79,7 @@
        -h     Print usage information.  (-help and --help are equivalent.)
 
 BUGS
-       Some PDF files contain fonts whose encodings have been  mangled  beyond
+       Some  PDF  files contain fonts whose encodings have been mangled beyond
        recognition.  There is no way (short of OCR) to extract text from these
        files.
 
@@ -74,14 +97,14 @@
        99     Other error.
 
 AUTHOR
-       The pdftohtml software and documentation are copyright 1996-2014  Glyph
+       The  pdftohtml software and documentation are copyright 1996-2017 Glyph
        & Cog, LLC.
 
 SEE ALSO
        xpdf(1),  pdftops(1),  pdftotext(1),  pdfinfo(1),  pdffonts(1),  pdfde-
        tach(1), pdftoppm(1), pdftopng(1), pdfimages(1), xpdfrc(5)
-       http://www.foolabs.com/xpdf/
+       http://www.xpdfreader.com/
 
 
 
-                                  28 May 2014                     pdftohtml(1)
+                                  10 Aug 2017                     pdftohtml(1)

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdftopng.1
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdftopng.1	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdftopng.1	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,8 +1,8 @@
-.\" Copyright 2014 Glyph & Cog, LLC
-.TH pdftopng 1 "28 May 2014"
+.\" Copyright 2017 Glyph & Cog, LLC
+.TH pdftopng 1 "10 Aug 2017"
 .SH NAME
 pdftopng \- Portable Document Format (PDF) to Portable Network Graphics
-(PNG) converter (version 3.04)
+(PNG) converter (version 4.00)
 .SH SYNOPSIS
 .B pdftopng
 [options]
@@ -51,6 +51,11 @@
 .B \-gray
 Generate a grayscale image (instead of a color image).
 .TP
+.B \-alpha
+Generate an alpha channel in the PNG file.  This is only useful with
+PDF files that have been constructed with a transparent background.
+The \-alpha flag cannot be used with \-mono.
+.TP
 .BI \-freetype " yes | no"
 Enable or disable FreeType (a TrueType / Type 1 font rasterizer).
 This defaults to "yes".
@@ -102,7 +107,7 @@
 99
 Other error.
 .SH AUTHOR
-The pdftopng software and documentation are copyright 1996-2014 Glyph
+The pdftopng software and documentation are copyright 1996-2017 Glyph
 & Cog, LLC.
 .SH "SEE ALSO"
 .BR xpdf (1),
@@ -116,4 +121,4 @@
 .BR pdfimages (1),
 .BR xpdfrc (5)
 .br
-.B http://www.foolabs.com/xpdf/
+.B http://www.xpdfreader.com/

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdftopng.cat
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdftopng.cat	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdftopng.cat	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,10 +1,10 @@
-pdftopng(1)                                                        pdftopng(1)
+pdftopng(1)                 General Commands Manual                pdftopng(1)
 
 
 
 NAME
        pdftopng  - Portable Document Format (PDF) to Portable Network Graphics
-       (PNG) converter (version 3.04)
+       (PNG) converter (version 4.00)
 
 SYNOPSIS
        pdftopng [options] PDF-file PNG-root
@@ -44,6 +44,10 @@
 
        -gray  Generate a grayscale image (instead of a color image).
 
+       -alpha Generate  an alpha channel in the PNG file.  This is only useful
+              with PDF files that have been  constructed  with  a  transparent
+              background.  The -alpha flag cannot be used with -mono.
+
        -freetype yes | no
               Enable  or  disable  FreeType  (a TrueType / Type 1 font raster-
               izer).  This defaults to "yes".  [config file: enableFreeType]
@@ -83,14 +87,14 @@
        99     Other error.
 
 AUTHOR
-       The pdftopng software and documentation are copyright 1996-2014 Glyph &
+       The pdftopng software and documentation are copyright 1996-2017 Glyph &
        Cog, LLC.
 
 SEE ALSO
        xpdf(1),  pdftops(1),  pdftotext(1),  pdftohtml(1),  pdfinfo(1),   pdf-
        fonts(1), pdfdetach(1), pdftoppm(1), pdfimages(1), xpdfrc(5)
-       http://www.foolabs.com/xpdf/
+       http://www.xpdfreader.com/
 
 
 
-                                  28 May 2014                      pdftopng(1)
+                                  10 Aug 2017                      pdftopng(1)

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdftoppm.1
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdftoppm.1	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdftoppm.1	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,8 +1,8 @@
-.\" Copyright 2005-2014 Glyph & Cog, LLC
-.TH pdftoppm 1 "28 May 2014"
+.\" Copyright 2005-2017 Glyph & Cog, LLC
+.TH pdftoppm 1 "10 Aug 2017"
 .SH NAME
 pdftoppm \- Portable Document Format (PDF) to Portable Pixmap (PPM)
-converter (version 3.04)
+converter (version 4.00)
 .SH SYNOPSIS
 .B pdftoppm
 [options]
@@ -48,11 +48,14 @@
 Specifies the resolution, in DPI.  The default is 150 DPI.
 .TP
 .B \-mono
-Generate a monochrome PBM file (instead of a color PPM file).
+Generate a monochrome PBM file (instead of an RGB PPM file).
 .TP
 .B \-gray
-Generate a grayscale PGM file (instead of a color PPM file).
+Generate a grayscale PGM file (instead of an RGB PPM file).
 .TP
+.B \-cmyk
+Generate a CMYK PAM file (instead of an RGB PPM file).
+.TP
 .BI \-freetype " yes | no"
 Enable or disable FreeType (a TrueType / Type 1 font rasterizer).
 This defaults to "yes".
@@ -104,7 +107,7 @@
 99
 Other error.
 .SH AUTHOR
-The pdftoppm software and documentation are copyright 1996-2014 Glyph
+The pdftoppm software and documentation are copyright 1996-2017 Glyph
 & Cog, LLC.
 .SH "SEE ALSO"
 .BR xpdf (1),
@@ -118,4 +121,4 @@
 .BR pdfimages (1),
 .BR xpdfrc (5)
 .br
-.B http://www.foolabs.com/xpdf/
+.B http://www.xpdfreader.com/

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdftoppm.cat
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdftoppm.cat	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdftoppm.cat	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,10 +1,10 @@
-pdftoppm(1)                                                        pdftoppm(1)
+pdftoppm(1)                 General Commands Manual                pdftoppm(1)
 
 
 
 NAME
        pdftoppm - Portable Document Format (PDF) to Portable Pixmap (PPM) con-
-       verter (version 3.04)
+       verter (version 4.00)
 
 SYNOPSIS
        pdftoppm [options] PDF-file PPM-root
@@ -41,10 +41,12 @@
        -r number
               Specifies the resolution, in DPI.  The default is 150 DPI.
 
-       -mono  Generate a monochrome PBM file (instead of a color PPM file).
+       -mono  Generate a monochrome PBM file (instead of an RGB PPM file).
 
-       -gray  Generate a grayscale PGM file (instead of a color PPM file).
+       -gray  Generate a grayscale PGM file (instead of an RGB PPM file).
 
+       -cmyk  Generate a CMYK PAM file (instead of an RGB PPM file).
+
        -freetype yes | no
               Enable or disable FreeType (a TrueType /  Type  1  font  raster-
               izer).  This defaults to "yes".  [config file: enableFreeType]
@@ -84,14 +86,14 @@
        99     Other error.
 
 AUTHOR
-       The pdftoppm software and documentation are copyright 1996-2014 Glyph &
+       The pdftoppm software and documentation are copyright 1996-2017 Glyph &
        Cog, LLC.
 
 SEE ALSO
        xpdf(1),   pdftops(1),  pdftotext(1),  pdftohtml(1),  pdfinfo(1),  pdf-
        fonts(1), pdfdetach(1), pdftopng(1), pdfimages(1), xpdfrc(5)
-       http://www.foolabs.com/xpdf/
+       http://www.xpdfreader.com/
 
 
 
-                                  28 May 2014                      pdftoppm(1)
+                                  10 Aug 2017                      pdftoppm(1)

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdftops.1
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdftops.1	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdftops.1	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,8 +1,8 @@
-.\" Copyright 1996-2014 Glyph & Cog, LLC
-.TH pdftops 1 "28 May 2014"
+.\" Copyright 1996-2017 Glyph & Cog, LLC
+.TH pdftops 1 "10 Aug 2017"
 .SH NAME
 pdftops \- Portable Document Format (PDF) to PostScript converter
-(version 3.04)
+(version 4.00)
 .SH SYNOPSIS
 .B pdftops
 [options]
@@ -65,6 +65,11 @@
 compression.  This is the default setting.
 .RB "[config file: " psLevel ]
 .TP
+.B \-level2gray
+Generate grayscale Level 2 PostScript.  All colors, including images,
+are converted to grayscale.
+.RB "[config file: " psLevel ]
+.TP
 .B \-level2sep
 Generate Level 2 separable PostScript.  All colors are converted to
 CMYK.  The PostScript separation convention operators are used to
@@ -76,6 +81,11 @@
 CID font embedding and masked image generation.
 .RB "[config file: " psLevel ]
 .TP
+.B \-level3gray
+Generate grayscale Level 3 PostScript.  All colors, including images,
+are converted to grayscale.
+.RB "[config file: " psLevel ]
+.TP
 .B \-level3Sep
 Generate Level 3 separable PostScript.  The separation handling is the
 same as for \-level2Sep.
@@ -174,6 +184,10 @@
 used as the page size.
 .RB "[config file: " psUseCropBoxAsPage ]
 .TP
+.B \-userunit
+Honor the UserUnit settings on PDF pages when computing page/paper
+size.  By default, pdftops ignores UserUnit.
+.TP
 .B \-duplex
 Set the Duplex pagedevice entry in the PostScript file.  This tells
 duplex-capable printers to enable duplexing.
@@ -222,7 +236,7 @@
 99
 Other error.
 .SH AUTHOR
-The pdftops software and documentation are copyright 1996-2014 Glyph &
+The pdftops software and documentation are copyright 1996-2017 Glyph &
 Cog, LLC.
 .SH "SEE ALSO"
 .BR xpdf (1),
@@ -236,4 +250,4 @@
 .BR pdfimages (1),
 .BR xpdfrc (5)
 .br
-.B http://www.foolabs.com/xpdf/
+.B http://www.xpdfreader.com/

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdftops.cat
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdftops.cat	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdftops.cat	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,10 +1,10 @@
-pdftops(1)                                                          pdftops(1)
+pdftops(1)                  General Commands Manual                 pdftops(1)
 
 
 
 NAME
        pdftops  - Portable Document Format (PDF) to PostScript converter (ver-
-       sion 3.04)
+       sion 4.00)
 
 SYNOPSIS
        pdftops [options] [PDF-file [PS-file]]
@@ -54,16 +54,24 @@
               image compression.  This is the default setting.  [config  file:
               psLevel]
 
+       -level2gray
+              Generate  grayscale  Level  2 PostScript.  All colors, including
+              images, are converted to grayscale.  [config file: psLevel]
+
        -level2sep
               Generate Level 2 separable PostScript.  All colors are converted
-              to CMYK.  The PostScript  separation  convention  operators  are
+              to  CMYK.   The  PostScript  separation convention operators are
               used to handle custom (spot) colors.  [config file: psLevel]
 
        -level3
-              Generate  Level 3 PostScript.  This enables all Level 2 features
-              plus CID font embedding and masked  image  generation.   [config
+              Generate Level 3 PostScript.  This enables all Level 2  features
+              plus  CID  font  embedding and masked image generation.  [config
               file: psLevel]
 
+       -level3gray
+              Generate grayscale Level 3 PostScript.   All  colors,  including
+              images, are converted to grayscale.  [config file: psLevel]
+
        -level3Sep
               Generate  Level 3 separable PostScript.  The separation handling
               is the same as for -level2Sep.  [config file: psLevel]
@@ -153,13 +161,17 @@
               Treat  the CropBox as the PDF page size.  By default, the Media-
               Box is used as the page size.  [config file: psUseCropBoxAsPage]
 
+       -userunit
+              Honor  the  UserUnit  settings  on  PDF  pages  when   computing
+              page/paper size.  By default, pdftops ignores UserUnit.
+
        -duplex
-              Set the Duplex pagedevice entry in the  PostScript  file.   This
-              tells  duplex-capable  printers  to  enable  duplexing.  [config
+              Set  the  Duplex  pagedevice entry in the PostScript file.  This
+              tells duplex-capable  printers  to  enable  duplexing.   [config
               file: psDuplex]
 
        -opw password
-              Specify the owner password for the  PDF  file.   Providing  this
+              Specify  the  owner  password  for the PDF file.  Providing this
               will bypass all security restrictions.
 
        -upw password
@@ -189,14 +201,14 @@
        99     Other error.
 
 AUTHOR
-       The pdftops software and documentation are copyright 1996-2014 Glyph  &
+       The  pdftops software and documentation are copyright 1996-2017 Glyph &
        Cog, LLC.
 
 SEE ALSO
-       xpdf(1),  pdftotext(1),  pdftohtml(1),  pdfinfo(1), pdffonts(1), pdfde-
+       xpdf(1), pdftotext(1), pdftohtml(1),  pdfinfo(1),  pdffonts(1),  pdfde-
        tach(1), pdftoppm(1), pdftopng(1), pdfimages(1), xpdfrc(5)
-       http://www.foolabs.com/xpdf/
+       http://www.xpdfreader.com/
 
 
 
-                                  28 May 2014                       pdftops(1)
+                                  10 Aug 2017                       pdftops(1)

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdftotext.1
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdftotext.1	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdftotext.1	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,8 +1,8 @@
-.\" Copyright 1997-2014 Glyph & Cog, LLC
-.TH pdftotext 1 "28 May 2014"
+.\" Copyright 1997-2017 Glyph & Cog, LLC
+.TH pdftotext 1 "10 Aug 2017"
 .SH NAME
 pdftotext \- Portable Document Format (PDF) to text converter
-(version 3.04)
+(version 4.00)
 .SH SYNOPSIS
 .B pdftotext
 [options]
@@ -52,6 +52,13 @@
 option is given, character spacing within each line will be determined
 by the specified character pitch.
 .TP
+.B \-simple
+Similar to
+.BR \-layout ,
+but optimized for simple one-column pages.  This mode will do a better
+job of maintaining horizontal spacing, but it will only work properly
+with a single column of text.
+.TP
 .B \-table
 Table mode is similar to physical layout mode, but optimized for
 tabular data, with the goal of keeping rows and columns aligned (at
@@ -92,6 +99,11 @@
 layout, and then added back in.  This can be helpful for tables where
 clipped (invisible) text would overlap the next column.
 .TP
+.B \-nodiag
+Diagonal text, i.e., text that is not close to one of the 0, 90, 180,
+or 270 degree axes, is discarded.  This is useful to skip watermarks
+drawn on top of body text, etc.
+.TP
 .BI \-enc " encoding-name"
 Sets the encoding to use for text output.  The
 .I encoding\-name
@@ -109,6 +121,10 @@
 Don't insert page breaks (form feed characters) between pages.
 .RB "[config file: " textPageBreaks ]
 .TP
+.B \-bom
+Insert a Unicode byte order marker (BOM) at the start of the text
+output.
+.TP
 .BI \-opw " password"
 Specify the owner password for the PDF file.  Providing this will
 bypass all security restrictions.
@@ -156,7 +172,7 @@
 99
 Other error.
 .SH AUTHOR
-The pdftotext software and documentation are copyright 1996-2014 Glyph
+The pdftotext software and documentation are copyright 1996-2017 Glyph
 & Cog, LLC.
 .SH "SEE ALSO"
 .BR xpdf (1),
@@ -170,4 +186,4 @@
 .BR pdfimages (1),
 .BR xpdfrc (5)
 .br
-.B http://www.foolabs.com/xpdf/
+.B http://www.xpdfreader.com/

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdftotext.cat
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdftotext.cat	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/doc/pdftotext.cat	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,10 +1,10 @@
-pdftotext(1)                                                      pdftotext(1)
+pdftotext(1)                General Commands Manual               pdftotext(1)
 
 
 
 NAME
        pdftotext  -  Portable Document Format (PDF) to text converter (version
-       3.04)
+       4.00)
 
 SYNOPSIS
        pdftotext [options] [PDF-file [text-file]]
@@ -41,21 +41,27 @@
               -fixed  option is given, character spacing within each line will
               be determined by the specified character pitch.
 
+       -simple
+              Similar to -layout, but optimized for simple  one-column  pages.
+              This  mode  will do a better job of maintaining horizontal spac-
+              ing, but it will only work properly  with  a  single  column  of
+              text.
+
        -table Table mode is similar to physical layout mode, but optimized for
-              tabular  data, with the goal of keeping rows and columns aligned
-              (at the expense of inserting extra whitespace).  If  the  -fixed
-              option  is  given,  character  spacing  within each line will be
+              tabular data, with the goal of keeping rows and columns  aligned
+              (at  the  expense of inserting extra whitespace).  If the -fixed
+              option is given, character spacing  within  each  line  will  be
               determined by the specified character pitch.
 
        -lineprinter
               Line  printer  mode  uses  a  strict  fixed-character-pitch  and
-              -height  layout.   That  is, the page is broken into a grid, and
-              characters are placed into that grid.  If the  grid  spacing  is
-              too  small for the actual characters, the result is extra white-
-              space.  If the grid spacing is too large, the result is  missing
-              whitespace.   The grid spacing can be specified using the -fixed
-              and -linespacing options.  If one or both are not given  on  the
-              command  line,  pdftotext  will  attempt  to compute appropriate
+              -height layout.  That is, the page is broken into  a  grid,  and
+              characters  are  placed  into that grid.  If the grid spacing is
+              too small for the actual characters, the result is extra  white-
+              space.   If the grid spacing is too large, the result is missing
+              whitespace.  The grid spacing can be specified using the  -fixed
+              and  -linespacing  options.  If one or both are not given on the
+              command line, pdftotext  will  attempt  to  compute  appropriate
               value(s).
 
        -raw   Keep the text in content stream order.  Depending on how the PDF
@@ -62,22 +68,27 @@
               file was generated, this may or may not be useful.
 
        -fixed number
-              Specify  the  character  pitch (character width), in points, for
-              physical layout, table, or line printer mode.  This  is  ignored
+              Specify the character pitch (character width),  in  points,  for
+              physical  layout,  table, or line printer mode.  This is ignored
               in all other modes.
 
        -linespacing number
-              Specify  the  line  spacing,  in  points, for line printer mode.
+              Specify the line spacing, in  points,  for  line  printer  mode.
               This is ignored in all other modes.
 
        -clip  Text which is hidden because of clipping is removed before doing
-              layout,  and then added back in.  This can be helpful for tables
+              layout, and then added back in.  This can be helpful for  tables
               where clipped (invisible) text would overlap the next column.
 
+       -nodiag
+              Diagonal text, i.e., text that is not close to one of the 0, 90,
+              180, or 270 degree axes, is discarded.  This is useful  to  skip
+              watermarks drawn on top of body text, etc.
+
        -enc encoding-name
-              Sets the encoding to use for  text  output.   The  encoding-name
-              must  be  defined  with  the unicodeMap command (see xpdfrc(5)).
-              The encoding name is case-sensitive.  This defaults to  "Latin1"
+              Sets  the  encoding  to  use for text output.  The encoding-name
+              must be defined with the  unicodeMap  command  (see  xpdfrc(5)).
+              The  encoding name is case-sensitive.  This defaults to "Latin1"
               (which is a built-in encoding).  [config file: textEncoding]
 
        -eol unix | dos | mac
@@ -85,9 +96,12 @@
               file: textEOL]
 
        -nopgbrk
-              Don't insert page breaks (form feed characters)  between  pages.
+              Don't  insert  page breaks (form feed characters) between pages.
               [config file: textPageBreaks]
 
+       -bom   Insert a Unicode byte order marker (BOM) at  the  start  of  the
+              text output.
+
        -opw password
               Specify  the  owner  password  for the PDF file.  Providing this
               will bypass all security restrictions.
@@ -124,14 +138,14 @@
        99     Other error.
 
 AUTHOR
-       The  pdftotext software and documentation are copyright 1996-2014 Glyph
+       The  pdftotext software and documentation are copyright 1996-2017 Glyph
        & Cog, LLC.
 
 SEE ALSO
        xpdf(1),  pdftops(1),  pdftohtml(1),  pdfinfo(1),  pdffonts(1),  pdfde-
        tach(1), pdftoppm(1), pdftopng(1), pdfimages(1), xpdfrc(5)
-       http://www.foolabs.com/xpdf/
+       http://www.xpdfreader.com/
 
 
 
-                                  28 May 2014                     pdftotext(1)
+                                  10 Aug 2017                     pdftotext(1)

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/doc/sample-xpdfrc
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/doc/sample-xpdfrc	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/doc/sample-xpdfrc	2017-11-01 18:15:56 UTC (rev 780)
@@ -16,7 +16,7 @@
 # Also, the Xpdf language support packages each include a set of
 # options to be added to the xpdfrc file.
 #
-# http://www.foolabs.com/xpdf/
+# http://www.xpdfreader.com/
 #
 #========================================================================
 

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/doc/xpdf.1
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/doc/xpdf.1	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/doc/xpdf.1	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,20 +1,20 @@
-.\" Copyright 1996-2014 Glyph & Cog, LLC
-.TH xpdf 1 "28 May 2014"
+.\" Copyright 1996-2017 Glyph & Cog, LLC
+.TH xpdf 1 "10 Aug 2017"
 .SH NAME
-xpdf \- Portable Document Format (PDF) file viewer for X (version 3.04)
+xpdf \- Portable Document Format (PDF) file viewer (version 4.00)
 .SH SYNOPSIS
 .B xpdf
 [options]
 .RI [ PDF-file
-.RI [ page " | +" dest ]]
+.RI [: page " | +" dest "]] ..."
 .SH DESCRIPTION
 .B Xpdf
 is a viewer for Portable Document Format (PDF) files.  (These are also
 sometimes also called \'Acrobat' files, from the name of Adobe's PDF
-software.)  Xpdf runs under the X Window System on UNIX, VMS, and
-OS/2.
+software.)  Xpdf uses the Qt GUI toolkit and runs on Unix, OS X, and
+Windows.
 .PP
-To run xpdf, simply type:
+To run xpdf, type:
 .PP
 .RS
 xpdf file.pdf
@@ -22,17 +22,27 @@
 .PP
 where
 .I file.pdf
-is your PDF file.  The file name can be followed by a number
-specifying the page which should be displayed first, e.g.:
+is your PDF file.  The file name can be followed by a page number to
+be displayed, prefixed with a colon:
 .PP
 .RS
-xpdf file.pdf 18
+xpdf file.pdf :18
 .RE
 .PP
-You can also give a named destination, prefixed with \'+' in place of
-the page number.  (This is only useful with PDF files that provide
-named destination targets.)
+or by a named destination, prefixed with \'+' (this is only useful
+with PDF files that provide named destination targets):
 .PP
+.RS
+xpdf file.pdf +destinationA
+.RE
+.PP
+If you specify multiple files, they will each be opened in a separate
+tab:
+.PP
+.RS
+xpdf file1.pdf file2.pdf :18 file3.pdf
+.RE
+.PP
 You can also start xpdf without opening any files:
 .PP
 .RS
@@ -46,67 +56,50 @@
 .BR xpdfrc (5)
 man page for details.
 .SH OPTIONS
-Many of the following options can be set with configuration file
-commands or X resources.  These are listed in square brackets with the
-description of the corresponding command line option.
+The following command line options are available.  All command line
+options must come before any PDF files to be opened.
+.PP
+Many of the options can be set with configuration file commands.
+These are listed in square brackets with the description of the
+corresponding command line option.
 .TP
-.BI \-g " geometry"
+.BI \-geometry " geometry"
 Set the initial window geometry.
-.RB ( \-geometry
-is equivalent.)
-.RB "[X resource: " xpdf.geometry ]
 .TP
 .BI \-title " title"
 Set the window title.  By default, the title will be "xpdf: foo.pdf".
-.RB "[X resource: " xpdf.title ]
 .TP
-.B \-cmap
-Install a private colormap.  This is ignored on TrueColor visuals.
-.RB "[X resource: " xpdf.installCmap ]
-.TP
-.BI \-rgb " number"
-Set the size of largest RGB cube xpdf will try to allocate.  The
-default is 5 (for a 5x5x5 cube); set to a smaller number to conserve
-color table entries.  This is ignored with private colormaps and on
-TrueColor visuals.
-.RB "[X resource: " xpdf.rgbCubeSize ]
-.TP
 .B \-rv
 Set reverse video mode.  This reverses the colors of everything except
 images.  It may not always produce great results for PDF files which
 do weird things with color.  This also causes the paper color to
 default to black.
-.RB "[X resource: " xpdf.reverseVideo ]
 .TP
 .BI \-papercolor " color"
-Set the "paper color", i.e., the background of the page display.  This
-will not work too well with PDF files that do things like filling in
-white behind the text.
-.RB "[X resource: " xpdf.paperColor ]
+Set the "paper color", i.e., the background of the page display.  The
+color can be #RRGGBB (hexadecimal) or a named color.  This option will
+not work well with PDF files that do things like filling in white
+behind the text.
+.RB "[config file: " paperColor ]
 .TP
 .BI \-mattecolor " color"
 Set the matte color, i.e., the color used for background outside the
-actual page area.  (There is a separate setting,
-xpdf.fullScreenMatteColor, for full-screen mode.)
-.RB "[X resource: " xpdf.matteColor ]
+actual page area.  The color can be #RRGGBB (hexadecimal) or a named
+color.
+.RB "[config file: " matteColor ]
 .TP
+.BI \-fsmattecolor " color"
+Set the matte color for full-screen mode.  The color can be #RRGGBB
+(hexadecimal) or a named color.
+.RB "[config file: " fullScreenMatteColor ]
+.TP
 .BI \-z " zoom"
 Set the initial zoom factor.  A number specifies a zoom percentage,
 where 100 means 72 dpi.  You may also specify \'page', to fit the page
 to the window size, or \'width', to fit the page width to the window
 width.
-.RB "[config file: " initialZoom "; or X resource: " xpdf.initialZoom ]
+.RB "[config file: " initialZoom ]
 .TP
-.B \-cont
-Start in continuous view mode, i.e., with one vertical scroll bar for
-the whole document.
-.RB "[config file: " continuousView ]
-.TP
-.BI \-freetype " yes | no"
-Enable or disable FreeType (a TrueType / Type 1 font rasterizer).
-This defaults to "yes".
-.RB "[config file: " enableFreeType ]
-.TP
 .BI \-aa " yes | no"
 Enable or disable font anti-aliasing.  This defaults to "yes".
 .RB "[config file: " antialias ]
@@ -115,32 +108,6 @@
 Enable or disable vector anti-aliasing.  This defaults to "yes".
 .RB "[config file: " vectorAntialias ]
 .TP
-.BI \-ps " PS-file"
-Set the default file name for PostScript output (i.e., the name which
-will appear in the print dialog).  This can also be of the form
-\'|command' to pipe the PostScript through a command.
-.RB "[config file: " psFile ]
-.TP
-.BI \-paper " size"
-Set the paper size to one of "letter", "legal", "A4", or "A3".  This
-can also be set to "match", which will set the paper size to match the
-size specified in the PDF file.
-.RB "[config file: " psPaperSize ]
-.TP
-.BI \-paperw " size"
-Set the paper width, in points.
-.RB "[config file: " psPaperSize ]
-.TP
-.BI \-paperh " size"
-Set the paper height, in points.
-.RB "[config file: " psPaperSize ]
-.TP
-.B \-level1
-Generate Level 1 PostScript.  The resulting PostScript files will be
-significantly larger (if they contain images), but will print on Level
-1 printers.  This also converts all images to black and white.
-.RB "[config file: " psLevel ]
-.TP
 .BI \-enc " encoding-name"
 Sets the encoding to use for text output.  The
 .I encoding\-name
@@ -149,47 +116,21 @@
 This defaults to "Latin1" (which is a built-in encoding).
 .RB "[config file: " textEncoding ]
 .TP
-.BI \-eol " unix | dos | mac"
-Sets the end-of-line convention to use for text output.
-.RB "[config file: " textEOL ]
+.BI \-pw " password"
+Specify the password for the PDF file.  This can be either the owner
+password (which will bypass all security restrictions) or the user
+password.
 .TP
-.BI \-opw " password"
-Specify the owner password for the PDF file.  Providing this will
-bypass all security restrictions.
-.TP
-.BI \-upw " password"
-Specify the user password for the PDF file.
-.TP
 .B \-fullscreen
 Open xpdf in full-screen mode, useful for presentations.
 .TP
-.BI \-remote " name"
-Start/contact xpdf remote server with specified name (see the
-.B "REMOTE SERVER MODE"
-section below).
+.BI \-display " display"
+Set the X display (only available with X11).
 .TP
-.BI \-exec " command"
-Execute a command (see the
-.B COMMANDS
-section below) in an xpdf remote server window (with \-remote only).
-.TP
-.B \-reload
-Reload xpdf remote server window (with \-remote only).
-.TP
-.B \-raise
-Raise xpdf remote server window (with \-remote only).
-.TP
-.B \-quit
-Kill xpdf remote server (with \-remote only).
-.TP
 .B \-cmd
 Print commands as they're executed (useful for debugging).
 .RB "[config file: " printCommands ]
 .TP
-.B \-q
-Don't print any messages or errors.
-.RB "[config file: " errQuiet ]
-.TP
 .BI \-cfg " config-file"
 Read
 .I config-file
@@ -205,440 +146,404 @@
 .B \-\-help
 are equivalent.)
 .PP
-Several other standard X options and resources will work as expected:
+.SH CONTROLS
+.SS Tool bar
 .TP
-.BI \-display " display"
-.RB "[X resource: " xpdf.display ]
+.B "\'page' entry box"
+Move to a specific page number.  Click in the box to activate it, type
+the page number, then hit return.
 .TP
-.BI \-fg " color"
-.RB ( \-foreground
-is equivalent.)
-.RB "[X resource: " xpdf*Foreground ]
-.TP
-.BI \-bg " color"
-.RB ( \-background
-is equivalent.)
-.RB "[X resource: " xpdf*Background ]
-.TP
-.BI \-font " font"
-.RB ( \-fn
-is equivalent.)
-.RB "[X resource: " xpdf*fontList ]
-.PP
-The color and font options only affect the user interface elements,
-not the PDF display (the \'paper').
-.PP
-The following X resources do not have command line option equivalents:
-.TP
-.B xpdf.toolTipEnable
-Enables (if set to true) or disables (if set to false) the tool-tips
-on the toolbar buttons.
-.TP
-.B xpdf.fullScreenMatteColor
-Sets the matte color to be used in full-screen mode.  The default
-setting is "black".
-.SH CONTROLS
-.SS On-screen controls, at the bottom of the xpdf window
-.TP
 .B "left/right arrow buttons"
-Move to the previous/next page.
+Go backward or forward along the history path.
 .TP
-.B "double left/right arrow buttons"
-Move backward or forward by ten pages.
+.B "zoom out/in buttons"
+Zoom out or in (i.e., change magnification) incrementally.
 .TP
-.B "dashed left/right arrow buttons"
-Move backward or forward along the history path.
-.TP
-.B "\'Page' entry box"
-Move to a specific page number.  Click in the box to activate it, type
-the page number, then hit return.
-.TP
 .B "zoom popup menu"
 Change the zoom factor (see the description of the \-z option above).
 .TP
-.B "binoculars button"
-Find a text string.
+.B "fit width button"
+Change the zoom factor to fit the page width to the window width.
 .TP
-.B "print button"
-Bring up a dialog for generating a PostScript file.  The dialog has
-options to set the pages to be printed and the PostScript file name.
-The file name can be \'-' for stdout or \'|command' to pipe the
-PostScript through a command, e.g., \'|lpr'.
+.B "fit page button"
+Change the zoom factor to fit the page to the window size.
 .TP
-.B "\'?' button"
-Bring up the \'about xpdf' window.
+.B "working/error indicator"
+This icon is animated while Xpdf is rendering a page.  It turns red
+when an error or warning has been issued.  Clicking on it opens the
+error dialog.
 .TP
-.B "link info"
-The space between the \'?' and \'Quit' buttons is used to show the URL
-or external file name when the mouse is over a link.
+.B "\'find' box"
+Find a text string.  Click in the box to activate it, type a search
+string, then hit return.
 .TP
-.B "\'Quit' button"
-Quit xpdf.
-.PP
-.SS Menu
-Pressing the right mouse button will post a popup menu with the
-following commands:
+.B "find next button"
+Find the next occurrence of the search string.
 .TP
-.B "Open..."
-Open a new PDF file via a file requester.
+.B "find previous button"
+Find the previous occurrence of the search string.
 .TP
-.B "Open in new window..."
-Create a new window and open a new PDF file via a file requester.
-.TP
-.B "Reload"
-Reload the current PDF file.  Note that Xpdf will reload the file
-automatically (on a page change or redraw) if it has changed since it
-was last loaded.
-.TP
-.B "Save as..."
-Save the current file via a file requester.
-.TP
-.B "Continuous view"
-Toggles between single page and continuous view modes.
-.TP
-.B "Rotate counterclockwise"
-Rotate the page 90 degrees counterclockwise.
-.TP
-.B "Rotate clockwise"
-Rotate the page 90 degrees clockwise.  The two rotate commands are
-intended primarily for PDF files where the rotation isn't correctly
-specified in the file.
-.TP
-.B "Zoom to selection"
-Zoom in to the currently selected rectangle.
-.TP
-.B "Close"
-Close the current window.  If this is the only open window, the
-document is closed, but the window is left open (i.e., this menu
-command won't quit xpdf).
-.TP
-.B "Quit"
-Quit xpdf.
+.B "find settings button"
+Display the current find settings: case sensitive (on/off), find whole
+words (on/off).
 .PP
-.SS Outline
-If the PDF contains an outline (a.k.a., bookmarks), there will be an
-outline pane on the left side of the window.  The width of the outline
-pane is adjustable with a vertical split bar via the knob near its
-bottom end.
+.SS Menu bar
+The menu bar is above the tool bar.  The menu items should be
+self-explanatory.
 .PP
+.SS Tab list
+The tab list is on the left, just below the tool bar.  It lists all
+open tabs.
+.PP
+.SS Outline/layers/attachments pane
+This pane is on the left, below the tab list.  The popup allows you to
+select from outline, layers, or attachments.
+.PP
+The outline is a tree-like structure of bookmarks that allows moving
+within the PDF file.  Not all PDF files have outlines.
+.PP
+Layers (a.k.a. optional content) allow parts of the PDF content to be
+shown or hidden.  Not all PDF files have layers.
+.PP
+Attachments are other files embedded within the PDF file.  There is
+a 'save' button for each attached file.  Not all PDF files have
+attachments.
+.PP
 .SS Text selection
 Dragging the mouse with the left button held down will highlight an
-arbitrary rectangle.  Any text inside this rectangle will be copied to
-the X selection buffer.
+arbitrary rectangle.  Selected text can be copied to the clipboard
+(with the edit/copy menu item).  On X11, selected text will be
+available in the X selection buffer.
 .PP
 .SS Links
+When the mouse is over a hyperlink, the link target will be shown in a
+popup near the bottom of the window.
+.PP
 Clicking on a hyperlink will jump to the link's destination.  A link
 to another PDF document will make xpdf load that document.  A
 \'launch' link to an executable program will display a dialog, and if
-you click \'ok', execute the program.  URL links call an external
-command (see the
-.B WEB BROWSERS
-section below).
+you click \'ok', execute the program.  URL links are opened in a
+system-dependent way.  (On UNIX, Qt uses the $BROWSER environment
+variable.)
 .PP
-.SS Panning
+.SS Mouse bindings
+The left mouse button is used to select text (see above).
+.PP
+Clicking on a link with the middle button opens the link in a new tab.
+.PP
 Dragging the mouse with the middle button held down pans the window.
 .PP
+The right mouse button opens a popup menu (see
+.BR popupMenuCmd " in " xpdfrc (5)).
+.PP
 .SS Key bindings
+This section lists the default key bindings.  Bindings can be changed
+using the config file (see
+.BR xpdfrc (5)).
 .TP
-.B o
+.B control-o
 Open a new PDF file via a file requester.
 .TP
-.B r
+.B control-r
 Reload the current PDF file.  Note that Xpdf will reload the file
 automatically (on a page change or redraw) if it has changed since it
 was last loaded.
 .TP
-.B control-L
-Redraw the current page.
+.B control-f
+Find a text string.  This sets keyboard focus to the \'find' box.
 .TP
-.B control-W
-Close the current window.
-.TP
-.B f or control-F
-Find a text string.
-.TP
 .B control-G
 Find next occurrence.
 .TP
+.B control-C
+Copy selected text to the clipboard.
+.TP
 .B control-P
 Print.
 .TP
-.B n
-Move to the next page.  Scrolls to the top of the page, unless scroll
-lock is turned on.
+.BR control-0 " (control-zero)"
+Set the zoom factor to 125%.
 .TP
-.B p
-Move to the previous page.  Scrolls to the top of the page, unless
-scroll lock is turned on.
+.BR control-+ " (control-plus)"
+Zoom in (increment the zoom factor by 1).
 .TP
-.BR <Space> " or " <PageDown> " or " <Next>
+.BR control-- " (control-minus)"
+Zoom out (decrement the zoom factor by 1).
+.TP
+.B control-s
+Save PDF via a file requester.
+.TP
+.B control-t
+Open a new tab.
+.TP
+.B control-n
+Open a new window.
+.TP
+.B control-w
+Close the current tab.  Closes the window if this was the last open
+tab.  Quits the application if this was the last open window.
+.TP
+.B control-q
+Quit.
+.TP
+.B control-<tab>
+Next tab.
+.TP
+.B control-shift-<tab>
+Previous tab.
+.TP
+.B control-?
+Help.
+.TP
+.B alt-<left-arrow>
+Go backward along the history path.
+.TP
+.B alt-<right-arrow>
+Go forward along the history path.
+.TP
+.B home
+Go to the top left of current page.
+.TP
+.B control-<home>
+Go to the first page.
+.TP
+.B end
+Go to the bottom right of current page.
+.TP
+.B control-<end>
+Go to the last page.
+.TP
+.BR <space> " or " <PageDown>
 Scroll down on the current page; if already at bottom, move to next
 page.
 .TP
-.BR <Backspace> " or " <Delete> " or " <PageUp> " or " <Previous>
+.BR control-<PageDown> " or " control-<down-arrow>
+Go to the next page.  If <ScrollLock> is active, this maintains the
+relative position on the page.
+.TP
+.B <PageUp>
 Scroll up on the current page; if already at top, move to previous
 page.
 .TP
-.B v
-Move forward along the history path.
+.BR control-<PageUp> " or " control-<up-arrow>
+Go to the previous page.  If <ScrollLock> is active, this maintains
+the relative position on the page.
 .TP
-.B b
-Move backward along the history path.
+.B <esc>
+Exit full-screen mode.
 .TP
-.B <Home>
-Scroll to top of current page.
-.TP
-.B <End>
-Scroll to bottom of current page.
-.TP
-.B control-<Home>
-Scroll to first page of document.
-.TP
-.B control-<End>
-Scroll to last page of document.
-.TP
 .B arrows
 Scroll the current page.
 .TP
 .B g
-Activate the page number text field ("goto page").
+Set keyboard focus to the page number entry box.
 .TP
-.B 0
-Set the zoom factor to 125%.
-.TP
-.B +
-Zoom in (increment the zoom factor by 1).
-.TP
-.B -
-Zoom out (decrement the zoom factor by 1).
-.TP
 .B z
-Set the zoom factor to 'page' (fit page to window).
+Set the zoom factor to \'page' (fit page to window).
 .TP
 .B w
-Set the zoom factor to 'width' (fit page width to window).
-.TP
-.B alt-F
-Toggle full-screen mode.
-.TP
-.B q
-Quit xpdf.
-.SH "WEB BROWSERS"
-If you want to run xpdf automatically from netscape or mosaic (and
-probably other browsers) when you click on a link to a PDF file, you
-need to edit (or create) the files
-.I .mime.types
-and
-.I .mailcap
-in your home directory.  In
-.I .mime.types
-add the line:
+Set the zoom factor to \'width' (fit page width to window).
+.SH Full-screen mode
+Xpdf can be placed into full-screen mode via the
+.B \-fullscreen
+command line option, the \'full screen' menu item, or a binding to the
+.B fullScreenMode
+or
+.BR toggleFullScreenMode command .
 .PP
-.RS
-application/pdf pdf
-.RE
+Entering full-screen mode automatically switches to single-page view
+mode and to the fit-page zoom factor.
 .PP
-In
-.I .mailcap
-add the lines:
-.PP
-.RS
-# Use xpdf to view PDF files.
-.RE
-.RS
-application/pdf; xpdf \-q %s
-.RE
-.PP
-Make sure that xpdf is on your executable search path.
-.PP
-When you click on a URL link in a PDF file, xpdf will execute the
-command specified by the urlCommand config file option, replacing an
-occurrence of \'%s' with the URL.  For example, to call netscape with
-the URL, add this line to your config file:
-.PP
-.RS
-urlCommand "netscape \-remote 'openURL(%s)'"
-.RE
+Full-screen mode can be exited via the default <esc> key binding,
+or via a binding to the
+.B windowMode
+or
+.BR toggleFullScreenMode command .
 .SH COMMANDS
-Xpdf's key and mouse bindings are user-configurable, using the bind and
-unbind options in the config file (see
+Xpdf's key and mouse bindings are user-configurable, using the bind
+and unbind commands in the config file (see
 .BR xpdfrc (5)).
 The bind command allows you to bind a key or mouse button to a
 sequence of one or more commands.
-.SS Available Commands
+.PP
 The following commands are supported:
 .TP
-.BI gotoPage( page )
-Go to the specified page.
+.B about
+Open the \'about' dialog.
 .TP
-.BI gotoPageNoScroll( page )
-Go to the specified page, with the current relative scroll position.
+.B blockSelectMode
+Set block selection mode.  In this mode, the selection is a simple
+rectangle.  Any part of the page can be selected, regardless of the
+content on the page.
 .TP
-.BI gotoDest( dest )
-Go to a named destination.
+.B closeSidebar
+Close the sidebar.
 .TP
-.B gotoLastPage
-Go to the last page in the PDF file.
+.B closeSidebarMoveResizeWin
+Close the sidebar, resizing the window so that the document size
+doesn't change, and moving the window so that the document stays in
+the same place on the screen.
 .TP
-.B gotoLastPageNoScroll
-Go to the last page in the PDF file, with the current relative scroll
-position.
+.B closeSidebarResizeWin
+Close the sidebar, resizing the window so that the document size
+doesn't change.
 .TP
-.B nextPage
-Go to the next page.
+.B closeTabOrQuit
+Close the tab.  If this was the last open tab, close the window.  If
+this was the last window open, quit.
 .TP
-.B nextPageNoScroll
-Go to the next page, with the current relative scroll position.
+.B closeWindowOrQuit
+Close the window.  If this was the last open window, quit.
 .TP
-.B prevPage
-Go to the previous page.
+.B continuousMode
+Switch to continuous view mode.
 .TP
-.B prevPageNoScroll
-Go to the previous page, with the current relative scroll position.
+.B copy
+Copy selected text to the clipboard.
 .TP
-.B pageUp
-Scroll up by one screenful.
+.B endPan
+End a pan operation.
 .TP
-.B pageDown
-Scroll down by one screenful.
+.B endSelection
+End a selection.
 .TP
-.BI scrollLeft( n )
-Scroll left by
-.I n
-pixels.
+.B find
+Set keyboard focus to the \'find' box.
 .TP
-.BI scrollRight( n )
-Scroll right by
-.I n
-pixels.
+.B findFirst
+Find the first occurrence of the search string.
 .TP
-.BI scrollUp( n )
-Scroll up by
-.I n
-pixels.
+.B findNext
+Find the next occurrence of the search string.
 .TP
-.BI scrollDown( n )
-Scroll down by
-.I n
-pixels.
+.B findPrevious
+Find the previous occurrence of the search string.
 .TP
-.BI scrollUpPrevPage( n )
-Scroll up by
-.I n
-pixels, moving to the previous page if appropriate.
+.B focusToDocWin
+Set keyboard focus to the main document window.
 .TP
-.BI scrollDownPrevPage( n )
-Scroll down by
-.I n
-pixels, moving to the next page if appropriate.
+.B focusToPageNum
+Set keyboard focus to the page number text box.
 .TP
-.B scrollToTopEdge
-Scroll to the top edge of the current page, with no horizontal
-movement.
+.B followLink
+Follow a hyperlink (does nothing if the mouse is not over a link).
 .TP
-.B scrollToBottomEdge
-Scroll to the bottom edge of the current page, with no horizontal
-movement.
+.B followLinkInNewTab
+Follow a hyperlink, opening PDF files in a new tab (does nothing if
+the mouse is not over a link).  For links to non-PDF files, this
+command is identical to followLink.
 .TP
-.B scrollToLeftEdge
-Scroll to the left edge of the current page, with no vertical
-movement.
+.B followLinkInNewTabNoSel
+Same as followLinkInNewTab, but does nothing if there is a non-empty
+selection.  (This is useful as a mouse button binding.)
 .TP
-.B scrollToRightEdge
-Scroll to the right edge of the current page, with no vertical
-movement.
+.B followLinkInNewWin
+Follow a hyperlink, opening PDF files in a new window (does nothing if
+the mouse is not over a link).  For links to non-PDF files, this
+command is identical to followLink.
 .TP
-.B scrollToTopLeft
-Scroll to the top-left corner of the current page.
+.B followLinkInNewWinNoSel
+Same as followLinkInNewWin, but does nothing if there is a non-empty
+selection.  (This is useful as a mouse button binding.)
 .TP
-.B scrollToBottomRight
-Scroll to the bottom-right corner of the current page.
+.B followLinkNoSel
+Same as followLink, but does nothing if there is a non-empty selection.
+(This is useful as a mouse button binding.)
 .TP
-.B goForward
-Move forward along the history path.
+.B fullScreenMode
+Go to full-screen mode.
 .TP
 .B goBackward
 Move backward along the history path.
 .TP
-.BI zoomPercent( z )
-Set the zoom factor to
-.IR z %.
+.B goForward
+Move forward along the history path.
 .TP
-.B zoomFitPage
-Set the zoom factor to fit-page.
+.BI gotoDest( dest )
+Go to a named destination.
 .TP
-.B zoomFitWidth
-Set the zoom factor to fit-width.
+.B gotoLastPage
+Go to the last page in the PDF file.
 .TP
-.B zoomIn
-Zoom in - go to the next higher zoom factor.
+.BI gotoPage( page )
+Go to the specified page.
 .TP
-.B zoomOut
-Zoom out - go the next lower zoom factor.
+.BI help
+Open the help URL.
 .TP
-.B rotateCW
-Rotate the page 90 degrees clockwise.
+.B horizontalContinuousMode
+Switch to horizontal continuous view mode.
 .TP
-.B rotateCCW
-Rotate the page 90 degrees counterclockwise.
+.B linearSelectMode
+Set linear selection mode.  In this mode, the selection follows text.
+Non-text regions cannot be selected.
 .TP
-.BI setSelection( pg , ulx , uly , lrx , lry )
-Set the selection to the specified coordinates on the specified page.
+.B newTab
+Open an empty new tab.
 .TP
-.B continuousMode
-Go to continuous view mode.
+.B newWindow
+Open an empty new window.
 .TP
-.B singlePageMode
-Go to single-page view mode.
+.B nextPage
+Go to the next page.
 .TP
-.B toggleContinuousMode
-Toggle between continuous and single page view modes.
+.B nextPageNoScroll
+Go to the next page, with the current relative scroll position.
 .TP
-.B fullScreenMode
-Go to full-screen mode.
+.B nextTab
+Switch to the next tab.
 .TP
-.B windowMode
-Go to window (non-full-screen) mode.
+.B open
+Open a PDF file in this tab, using the open dialog.
 .TP
-.B toggleFullScreenMode
-Toggle between full-screen and window modes.
+.B openErrorWindow
+Open the error window.
 .TP
-.B open
-Open a PDF file in this window, using the open dialog.
+.B openSidebar
+Open the sidebar.
 .TP
-.B openInNewWin
-Open a PDF file in a new window, using the open dialog.
+.B openSidebarMoveResizeWin
+Open the sidebar, resizing the window so that the document size
+doesn't change, and moving the window so that the document stays in
+the same place on the screen.
 .TP
-.BI openFile( file )
-Open a specified PDF file in this window.
+.B openSidebarResizeWin
+Open the sidebar, resizing the window so that the document size
+doesn't change.
 .TP
-.BI openFileInNewWin( file )
-Open a specified PDF file in a new window.
+.B pageDown
+Scroll down by one screenful.
 .TP
-.BI openFileAtDest( file , dest )
-Open a specified PDF file in this window and go to a named
-destination.
+.B pageUp
+Scroll up by one screenful.
 .TP
-.BI openFileAtDestInNewWin( file , dest )
-Open a specified PDF file in a new window and go to a named
-destination.
+.B postPopupMenu
+Display the popup menu.
 .TP
+.B prevPage
+Go to the previous page.
+.TP
+.B prevPageNoScroll
+Go to the previous page, with the current relative scroll position.
+.TP
+.B prevTab
+Switch to the previous tab.
+.TP
+.B print
+Open the \'print' dialog.
+.TP
+.B quit
+Quit from xpdf.
+.TP
 .B reload
 Reload the current PDF file.
 .TP
-.B redraw
-Redraw the window.
+.B rotateCCW
+Rotate the page 90 degrees counterclockwise.
 .TP
-.B raise
-Raise the window to the front.
+.B rotateCW
+Rotate the page 90 degrees clockwise.
 .TP
-.B closeWindow
-Close the window.  If this was the last open window, clear the window,
-but don't quit from Xpdf.
-.TP
-.B closeWindowOrQuit
-Close the window.  If this was the last open window, quit from Xpdf.
-.TP
 .BI run( external-command-string )
 Run an external command.  The following escapes are allowed in the
 command string:
@@ -675,15 +580,27 @@
 
 .fi
 .TP
-.B openOutline
-Open the outline pane.
+.B saveAs
+Save PDF via a file requester.
 .TP
-.B closeOutline
-Close the outline pane.
+.B saveImage
+Open the \'save image' dialog.
 .TP
-.B toggleOutline
-Toggle the outline pane between open and closed.
+.BI scrollDown( n )
+Scroll down by
+.I n
+pixels.
 .TP
+.BI scrollDownPrevPage( n )
+Scroll down by
+.I n
+pixels, moving to the next page if appropriate.
+.TP
+.BI scrollLeft( n )
+Scroll left by
+.I n
+pixels.
+.TP
 .BI scrollOutlineDown( n )
 Scroll the outline down by
 .I n
@@ -694,163 +611,105 @@
 .I n
 increments.
 .TP
-.B focusToDocWin
-Set the keyboard focus to the main document window.
+.BI scrollRight( n )
+Scroll right by
+.I n
+pixels.
 .TP
-.B focusToPageNum
-Set the keyboard focus to the page number text box.
+.B scrollToBottomEdge
+Scroll to the bottom edge of the current page, with no horizontal
+movement.
 .TP
-.B find
-Open the 'find' dialog.
+.B scrollToBottomRight
+Scroll to the bottom-right corner of the current page.
 .TP
-.B findNext
-Finds the next occurrence of the search string (no dialog).
+.B scrollToLeftEdge
+Scroll to the left edge of the current page, with no vertical
+movement.
 .TP
-.B print
-Open the 'print' dialog.
+.B scrollToRightEdge
+Scroll to the right edge of the current page, with no vertical
+movement.
 .TP
-.B about
-Open the 'about' dialog.
+.B scrollToTopEdge
+Scroll to the top edge of the current page, with no horizontal
+movement.
 .TP
-.B quit
-Quit from xpdf.
-.PP
-The following commands depend on the current mouse position:
+.B scrollToTopLeft
+Scroll to the top-left corner of the current page.
 .TP
-.B startSelection
-Start a selection, which will be extended as the mouse moves.
+.BI scrollUp( n )
+Scroll up by
+.I n
+pixels.
 .TP
-.B endSelection
-End a selection.
+.BI scrollUpPrevPage( n )
+Scroll up by
+.I n
+pixels, moving to the previous page if appropriate.
 .TP
+.BI setSelection( pg , ulx , uly , lrx , lry )
+Set the selection to the specified coordinates on the specified page.
+.TP
+.B sideBySideContinuousMode
+Switch to side-by-side continuous view mode.
+.TP
+.B sideBySideSingleMode
+Switch to side-by-side two-page view mode.
+.TP
+.B singlePageMode
+Switch to single-page view mode.
+.TP
 .B startPan
-Start a pan, which will scroll the document as the mouse moves
+Start a pan operation at the current mouse position, which will scroll
+the document as the mouse moves.
 .TP
-.B endPan
-End a pan.
+.B startSelection
+Start a selection at the current mouse position, which will be
+extended as the mouse moves.
 .TP
-.B postPopupMenu
-Display the popup menu.
+.B toggleContinuousMode
+Toggle between continuous and single page view modes.
 .TP
-.B followLink
-Follow a hyperlink (does nothing if the mouse is not over a link).
+.B toggleFullScreenMode
+Toggle between full-screen and window modes.
 .TP
-.B followLinkInNewWin
-Follow a hyperlink, opening PDF files in a new window (does nothing if
-the mouse is not over a link).  For links to non-PDF files, this
-command is identical to followLink.
+.B toggleSelectMode
+Toggle between block and linear selection mode.
 .TP
-.B followLinkNoSel
-Same as followLink, but does nothing if there is a non-empty selection.
-(This is useful as a mouse button binding.)
+.B toggleSidebar
+Toggle the sidebar between open and closed.
 .TP
-.B followLinkInNewWinNoSel
-Same as followLinkInNewWin, but does nothing if there is a non-empty
-selection.  (This is useful as a mouse button binding.)
-.SS Default Bindings
-The default mouse bindings are as follows:
-.nf
-
-    bind mousePress1    any         startSelection
-    bind mouseRelease1  any         endSelection followLinkNoSel
-    bind mousePress2    any         startPan
-    bind mouseRelease2  any         endPan
-    bind mousePress3    any         postPopupMenu
-    bind mousePress4    any         scrollUpPrevPage(16)
-    bind mousePress5    any         scrollDownNextPage(16)
-    bind mousePress6    any         scrollLeft(16)
-    bind mousePress7    any         scrollRight(16)
-
-.fi
-The default key bindings are as follows:
-.nf
-
-    bind ctrl-home      any         gotoPage(1)
-    bind home           any         scrollToTopLeft
-    bind ctrl-end       any         gotoLastPage
-    bind end            any         scrollToBottomRight
-    bind pgup           any         pageUp
-    bind backspace      any         pageUp
-    bind delete         any         pageUp
-    bind pgdn           any         pageDown
-    bind space          any         pageDown
-    bind left           any         scrollLeft(16)
-    bind right          any         scrollRight(16)
-    bind up             any         scrollUp(16)
-    bind down           any         scrollDown(16)
-    bind o              any         open
-    bind O              any         open
-    bind r              any         reload
-    bind R              any         reload
-    bind f              any         find
-    bind F              any         find
-    bind ctrl-f         any         find
-    bind ctrl-g         any         findNext
-    bind ctrl-p         any         print
-    bind n              scrLockOff  nextPage
-    bind N              scrLockOff  nextPage
-    bind n              scrLockOn   nextPageNoScroll
-    bind N              scrLockOn   nextPageNoScroll
-    bind p              scrLockOff  prevPage
-    bind P              scrLockOff  prevPage
-    bind p              scrLockOn   prevPageNoScroll
-    bind P              scrLockOn   prevPageNoScroll
-    bind v              any         goForward
-    bind b              any         goBackward
-    bind g              any         focusToPageNum
-    bind 0              any         zoomPercent(125)
-    bind +              any         zoomIn
-    bind -              any         zoomOut
-    bind z              any         zoomFitPage
-    bind w              any         zoomFitWidth
-    bind alt-f          any         toggleFullScreenMode
-    bind ctrl-l         any         redraw
-    bind ctrl-w         any         closeWindowOrQuit
-    bind ?              any         about
-    bind q              any         quit
-    bind Q              any         quit
-
-.fi
-Previous versions of xpdf included a "viKeys" X resource.  It is no
-longer available, but the following bindings are equivalent:
-.nf
-
-    bind h any scrollLeft(16)
-    bind l any scrollRight(16)
-    bind k any scrollUp(16)
-    bind j any scrollDown(16)
-
-.fi
-.SH "REMOTE SERVER MODE"
-Xpdf can be started in remote server mode by specifying a server name
-(in addition to the file name and page number).  For example:
-.PP
-.RS
-xpdf \-remote myServer file.pdf
-.RE
-.PP
-If there is currently no xpdf running in server mode with the name
-\'myServer', a new xpdf window will be opened.  If another command:
-.PP
-.RS
-xpdf \-remote myServer another.pdf 9
-.RE
-.PP
-is issued, a new copy of xpdf will not be started.  Instead, the first
-xpdf (the server) will load
-.I another.pdf
-and display page nine.  If the file name is the same:
-.PP
-.RS
-xpdf \-remote myServer another.pdf 4
-.RE
-.PP
-the xpdf server will simply display the specified page.
-.PP
-The \-raise option tells the server to raise its window; it can be
-specified with or without a file name and page number.
-.PP
-The \-quit option tells the server to close its window and exit.
+.B toggleSidebarMoveResizeWin
+Toggle the sidebar between open and closed, resizing the window so
+that the document size doesn't change, and moving the window so that
+the document stays in the same place on the screen.
+.TP
+.B toggleSidebarResizeWin
+Toggle the sidebar between open and closed, resizing the window so
+that the document size doesn't change.
+.TP
+.B windowMode
+Go to window (non-full-screen) mode.
+.TP
+.B zoomFitPage
+Set the zoom factor to fit-page.
+.TP
+.B zoomFitWidth
+Set the zoom factor to fit-width.
+.TP
+.B zoomIn
+Zoom in - go to the next higher zoom factor.
+.TP
+.B zoomOut
+Zoom out - go the next lower zoom factor.
+.TP
+.BI zoomPercent( z )
+Set the zoom factor to
+.IR z %.
+.TP
+.B zoomToSelection
+Zoom to the current selection.
 .SH EXIT CODES
 The Xpdf tools use the following exit codes:
 .TP
@@ -869,7 +728,7 @@
 99
 Other error.
 .SH AUTHOR
-The xpdf software and documentation are copyright 1996-2014 Glyph &
+The xpdf software and documentation are copyright 1996-2017 Glyph &
 Cog, LLC.
 .SH "SEE ALSO"
 .BR pdftops (1),
@@ -883,4 +742,4 @@
 .BR pdfimages (1),
 .BR xpdfrc (5)
 .br
-.B http://www.foolabs.com/xpdf/
+.B http://www.xpdfreader.com/

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/doc/xpdf.cat
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/doc/xpdf.cat	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/doc/xpdf.cat	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,32 +1,38 @@
-xpdf(1)                                                                xpdf(1)
+xpdf(1)                     General Commands Manual                    xpdf(1)
 
 
 
 NAME
-       xpdf - Portable Document Format (PDF) file viewer for X (version 3.04)
+       xpdf - Portable Document Format (PDF) file viewer (version 4.00)
 
 SYNOPSIS
-       xpdf [options] [PDF-file [page | +dest]]
+       xpdf [options] [PDF-file [:page | +dest]] ...
 
 DESCRIPTION
        Xpdf  is a viewer for Portable Document Format (PDF) files.  (These are
        also sometimes also called 'Acrobat' files, from the  name  of  Adobe's
-       PDF  software.)   Xpdf runs under the X Window System on UNIX, VMS, and
-       OS/2.
+       PDF  software.)   Xpdf  uses the Qt GUI toolkit and runs on Unix, OS X,
+       and Windows.
 
-       To run xpdf, simply type:
+       To run xpdf, type:
 
               xpdf file.pdf
 
        where file.pdf is your PDF file.  The file name can be  followed  by  a
-       number specifying the page which should be displayed first, e.g.:
+       page number to be displayed, prefixed with a colon:
 
-              xpdf file.pdf 18
+              xpdf file.pdf :18
 
-       You  can  also  give a named destination, prefixed with '+' in place of
-       the page number.  (This is only useful  with  PDF  files  that  provide
-       named destination targets.)
+       or  by a named destination, prefixed with '+' (this is only useful with
+       PDF files that provide named destination targets):
 
+              xpdf file.pdf +destinationA
+
+       If you specify multiple files, they will each be opened in  a  separate
+       tab:
+
+              xpdf file1.pdf file2.pdf :18 file3.pdf
+
        You can also start xpdf without opening any files:
 
               xpdf
@@ -39,58 +45,47 @@
        man page for details.
 
 OPTIONS
-       Many  of  the following options can be set with configuration file com-
-       mands or X resources.  These are listed in  square  brackets  with  the
-       description of the corresponding command line option.
+       The  following  command  line  options are available.  All command line
+       options must come before any PDF files to be opened.
 
-       -g geometry
-              Set the initial window geometry.  (-geometry is equivalent.)  [X
-              resource: xpdf.geometry]
+       Many of the options can be set with configuration file commands.  These
+       are listed in square brackets with the description of the corresponding
+       command line option.
 
+       -geometry geometry
+              Set the initial window geometry.
+
        -title title
               Set the window title.  By default,  the  title  will  be  "xpdf:
-              foo.pdf".  [X resource: xpdf.title]
+              foo.pdf".
 
-       -cmap  Install  a private colormap.  This is ignored on TrueColor visu-
-              als.  [X resource: xpdf.installCmap]
-
-       -rgb number
-              Set the size of largest RGB cube xpdf will try to allocate.  The
-              default is 5 (for a 5x5x5 cube); set to a smaller number to con-
-              serve color table entries.  This is ignored  with  private  col-
-              ormaps and on TrueColor visuals.  [X resource: xpdf.rgbCubeSize]
-
        -rv    Set  reverse video mode.  This reverses the colors of everything
               except images.  It may not always produce great results for  PDF
               files  which  do  weird things with color.  This also causes the
-              paper color to default to black.   [X  resource:  xpdf.reverseV-
-              ideo]
+              paper color to default to black.
 
        -papercolor color
               Set the "paper color", i.e., the background of the page display.
-              This will not work too well with PDF files that do  things  like
-              filling in white behind the text.  [X resource: xpdf.paperColor]
+              The  color  can be #RRGGBB (hexadecimal) or a named color.  This
+              option will not work well with PDF files  that  do  things  like
+              filling in white behind the text.  [config file: paperColor]
 
        -mattecolor color
               Set the matte color, i.e., the color used for background outside
-              the  actual  page  area.   (There   is   a   separate   setting,
-              xpdf.fullScreenMatteColor,  for full-screen mode.)  [X resource:
-              xpdf.matteColor]
+              the actual page area.  The color can be #RRGGBB (hexadecimal) or
+              a named color.  [config file: matteColor]
 
+       -fsmattecolor color
+              Set  the  matte  color  for  full-screen mode.  The color can be
+              #RRGGBB  (hexadecimal)  or  a  named   color.    [config   file:
+              fullScreenMatteColor]
+
        -z zoom
               Set the initial zoom factor.  A number specifies a zoom percent-
-              age,  where  100  means 72 dpi.  You may also specify 'page', to
-              fit the page to the window size, or 'width',  to  fit  the  page
-              width  to  the  window  width.   [config file: initialZoom; or X
-              resource: xpdf.initialZoom]
+              age, where 100 means 72 dpi.  You may also  specify  'page',  to
+              fit  the  page  to  the window size, or 'width', to fit the page
+              width to the window width.  [config file: initialZoom]
 
-       -cont  Start in continuous view mode, i.e., with  one  vertical  scroll
-              bar for the whole document.  [config file: continuousView]
-
-       -freetype yes | no
-              Enable  or  disable  FreeType  (a TrueType / Type 1 font raster-
-              izer).  This defaults to "yes".  [config file: enableFreeType]
-
        -aa yes | no
               Enable or disable font anti-aliasing.  This defaults  to  "yes".
               [config file: antialias]
@@ -99,70 +94,26 @@
               Enable or disable vector anti-aliasing.  This defaults to "yes".
               [config file: vectorAntialias]
 
-       -ps PS-file
-              Set the default file name for PostScript output (i.e., the  name
-              which will appear in the print dialog).  This can also be of the
-              form '|command' to pipe the PostScript through a command.  [con-
-              fig file: psFile]
-
-       -paper size
-              Set  the  paper size to one of "letter", "legal", "A4", or "A3".
-              This can also be set to "match", which will set the  paper  size
-              to  match  the  size  specified  in the PDF file.  [config file:
-              psPaperSize]
-
-       -paperw size
-              Set the paper width, in points.  [config file: psPaperSize]
-
-       -paperh size
-              Set the paper height, in points.  [config file: psPaperSize]
-
-       -level1
-              Generate Level 1 PostScript.   The  resulting  PostScript  files
-              will  be significantly larger (if they contain images), but will
-              print on Level 1 printers.  This also  converts  all  images  to
-              black and white.  [config file: psLevel]
-
        -enc encoding-name
-              Sets  the  encoding  to  use for text output.  The encoding-name
-              must be defined with the  unicodeMap  command  (see  xpdfrc(5)).
+              Sets the encoding to use for  text  output.   The  encoding-name
+              must  be  defined  with  the unicodeMap command (see xpdfrc(5)).
               This defaults to "Latin1" (which is a built-in encoding).  [con-
               fig file: textEncoding]
 
-       -eol unix | dos | mac
-              Sets the end-of-line convention to use for text output.  [config
-              file: textEOL]
+       -pw password
+              Specify  the  password for the PDF file.  This can be either the
+              owner password (which will bypass all security restrictions)  or
+              the user password.
 
-       -opw password
-              Specify  the  owner  password  for the PDF file.  Providing this
-              will bypass all security restrictions.
-
-       -upw password
-              Specify the user password for the PDF file.
-
        -fullscreen
               Open xpdf in full-screen mode, useful for presentations.
 
-       -remote name
-              Start/contact xpdf remote server with specified  name  (see  the
-              REMOTE SERVER MODE section below).
+       -display display
+              Set the X display (only available with X11).
 
-       -exec command
-              Execute  a  command  (see the COMMANDS section below) in an xpdf
-              remote server window (with -remote only).
-
-       -reload
-              Reload xpdf remote server window (with -remote only).
-
-       -raise Raise xpdf remote server window (with -remote only).
-
-       -quit  Kill xpdf remote server (with -remote only).
-
-       -cmd   Print commands  as  they're  executed  (useful  for  debugging).
+       -cmd   Print  commands  as  they're  executed  (useful  for debugging).
               [config file: printCommands]
 
-       -q     Don't print any messages or errors.  [config file: errQuiet]
-
        -cfg config-file
               Read config-file in place of ~/.xpdfrc or the system-wide config
               file.
@@ -171,388 +122,385 @@
 
        -h     Print usage information.  (-help and --help are equivalent.)
 
-       Several other standard X options and resources will work as expected:
+CONTROLS
+   Tool bar
+       'page' entry box
+              Move  to  a  specific page number.  Click in the box to activate
+              it, type the page number, then hit return.
 
-       -display display
-              [X resource: xpdf.display]
-
-       -fg color
-              (-foreground is equivalent.)  [X resource: xpdf*Foreground]
-
-       -bg color
-              (-background is equivalent.)  [X resource: xpdf*Background]
-
-       -font font
-              (-fn is equivalent.)  [X resource: xpdf*fontList]
-
-       The color and font options only affect the user interface elements, not
-       the PDF display (the 'paper').
-
-       The following X resources do not have command line option equivalents:
-
-       xpdf.toolTipEnable
-              Enables (if set to true) or disables (if set to false) the tool-
-              tips on the toolbar buttons.
-
-       xpdf.fullScreenMatteColor
-              Sets the matte color  to  be  used  in  full-screen  mode.   The
-              default setting is "black".
-
-CONTROLS
-   On-screen controls, at the bottom of the xpdf window
        left/right arrow buttons
-              Move to the previous/next page.
+              Go backward or forward along the history path.
 
-       double left/right arrow buttons
-              Move backward or forward by ten pages.
+       zoom out/in buttons
+              Zoom out or in (i.e., change magnification) incrementally.
 
-       dashed left/right arrow buttons
-              Move backward or forward along the history path.
-
-       'Page' entry box
-              Move  to  a  specific page number.  Click in the box to activate
-              it, type the page number, then hit return.
-
        zoom popup menu
               Change the zoom factor (see the description  of  the  -z  option
               above).
 
-       binoculars button
-              Find a text string.
+       fit width button
+              Change  the  zoom  factor  to  fit  the page width to the window
+              width.
 
-       print button
-              Bring  up a dialog for generating a PostScript file.  The dialog
-              has options to set the pages to be printed  and  the  PostScript
-              file name.  The file name can be '-' for stdout or '|command' to
-              pipe the PostScript through a command, e.g., '|lpr'.
+       fit page button
+              Change the zoom factor to fit the page to the window size.
 
-       '?' button
-              Bring up the 'about xpdf' window.
+       working/error indicator
+              This icon is animated while Xpdf is rendering a page.  It  turns
+              red  when  an  error or warning has been issued.  Clicking on it
+              opens the error dialog.
 
-       link info
-              The space between the '?' and 'Quit' buttons is used to show the
-              URL or external file name when the mouse is over a link.
+       'find' box
+              Find a text string.  Click in the box to  activate  it,  type  a
+              search string, then hit return.
 
-       'Quit' button
-              Quit xpdf.
+       find next button
+              Find the next occurrence of the search string.
 
-   Menu
-       Pressing the right mouse button will post a popup menu with the follow-
-       ing commands:
+       find previous button
+              Find the previous occurrence of the search string.
 
-       Open...
-              Open a new PDF file via a file requester.
+       find settings button
+              Display the current find settings: case sensitive (on/off), find
+              whole words (on/off).
 
-       Open in new window...
-              Create a new  window  and  open  a  new  PDF  file  via  a  file
-              requester.
+   Menu bar
+       The menu bar is above the tool bar.  The menu  items  should  be  self-
+       explanatory.
 
-       Reload Reload  the  current  PDF  file.  Note that Xpdf will reload the
-              file automatically (on a  page  change  or  redraw)  if  it  has
-              changed since it was last loaded.
+   Tab list
+       The  tab  list  is  on the left, just below the tool bar.  It lists all
+       open tabs.
 
-       Save as...
-              Save the current file via a file requester.
+   Outline/layers/attachments pane
+       This pane is on the left, below the tab list.  The popup allows you  to
+       select from outline, layers, or attachments.
 
-       Continuous view
-              Toggles between single page and continuous view modes.
+       The  outline  is  a tree-like structure of bookmarks that allows moving
+       within the PDF file.  Not all PDF files have outlines.
 
-       Rotate counterclockwise
-              Rotate the page 90 degrees counterclockwise.
+       Layers (a.k.a. optional content) allow parts of the PDF content  to  be
+       shown or hidden.  Not all PDF files have layers.
 
-       Rotate clockwise
-              Rotate  the  page 90 degrees clockwise.  The two rotate commands
-              are intended primarily for PDF files where  the  rotation  isn't
-              correctly specified in the file.
+       Attachments  are  other files embedded within the PDF file.  There is a
+       'save' button for each attached file.  Not all PDF files  have  attach-
+       ments.
 
-       Zoom to selection
-              Zoom in to the currently selected rectangle.
+   Text selection
+       Dragging  the  mouse  with  the left button held down will highlight an
+       arbitrary rectangle.  Selected text can  be  copied  to  the  clipboard
+       (with  the  edit/copy menu item).  On X11, selected text will be avail-
+       able in the X selection buffer.
 
-       Close  Close  the current window.  If this is the only open window, the
-              document is closed, but the window is left open (i.e., this menu
-              command won't quit xpdf).
+   Links
+       When the mouse is over a hyperlink, the link target will be shown in  a
+       popup near the bottom of the window.
 
-       Quit   Quit xpdf.
+       Clicking on a hyperlink will jump to the link's destination.  A link to
+       another PDF document will make xpdf load  that  document.   A  'launch'
+       link  to  an executable program will display a dialog, and if you click
+       'ok', execute the program.  URL links are opened in a  system-dependent
+       way.  (On UNIX, Qt uses the $BROWSER environment variable.)
 
-   Outline
-       If  the  PDF  contains an outline (a.k.a., bookmarks), there will be an
-       outline pane on the left side of the window.  The width of the  outline
-       pane is adjustable with a vertical split bar via the knob near its bot-
-       tom end.
+   Mouse bindings
+       The left mouse button is used to select text (see above).
 
-   Text selection
-       Dragging the mouse with the left button held  down  will  highlight  an
-       arbitrary  rectangle.  Any text inside this rectangle will be copied to
-       the X selection buffer.
+       Clicking on a link with the middle button opens the link in a new tab.
 
-   Links
-       Clicking on a hyperlink will jump to the link's destination.  A link to
-       another  PDF  document  will  make xpdf load that document.  A 'launch'
-       link to an executable program will display a dialog, and if  you  click
-       'ok', execute the program.  URL links call an external command (see the
-       WEB BROWSERS section below).
-
-   Panning
        Dragging the mouse with the middle button held down pans the window.
 
+       The  right  mouse  button  opens  a  popup  menu  (see  popupMenuCmd in
+       xpdfrc(5)).
+
    Key bindings
-       o      Open a new PDF file via a file requester.
+       This section lists the default key bindings.  Bindings can  be  changed
+       using the config file (see xpdfrc(5)).
 
-       r      Reload the current PDF file.  Note that  Xpdf  will  reload  the
-              file  automatically  (on  a  page  change  or  redraw) if it has
+       control-o
+              Open a new PDF file via a file requester.
+
+       control-r
+              Reload  the  current  PDF  file.  Note that Xpdf will reload the
+              file automatically (on a  page  change  or  redraw)  if  it  has
               changed since it was last loaded.
 
-       control-L
-              Redraw the current page.
+       control-f
+              Find a text string.  This sets keyboard focus to the 'find' box.
 
-       control-W
-              Close the current window.
-
-       f or control-F
-              Find a text string.
-
        control-G
               Find next occurrence.
 
+       control-C
+              Copy selected text to the clipboard.
+
        control-P
               Print.
 
-       n      Move to the next page.  Scrolls to the top of the  page,  unless
-              scroll lock is turned on.
+       control-0 (control-zero)
+              Set the zoom factor to 125%.
 
-       p      Move  to  the  previous  page.   Scrolls to the top of the page,
-              unless scroll lock is turned on.
+       control-+ (control-plus)
+              Zoom in (increment the zoom factor by 1).
 
-       <Space> or <PageDown> or <Next>
-              Scroll down on the current page; if already at bottom,  move  to
-              next page.
+       control-- (control-minus)
+              Zoom out (decrement the zoom factor by 1).
 
-       <Backspace> or <Delete> or <PageUp> or <Previous>
-              Scroll up on the current page; if already at top, move to previ-
-              ous page.
+       control-s
+              Save PDF via a file requester.
 
-       v      Move forward along the history path.
+       control-t
+              Open a new tab.
 
-       b      Move backward along the history path.
+       control-n
+              Open a new window.
 
-       <Home> Scroll to top of current page.
+       control-w
+              Close  the  current tab.  Closes the window if this was the last
+              open tab.  Quits the application if this was the last open  win-
+              dow.
 
-       <End>  Scroll to bottom of current page.
+       control-q
+              Quit.
 
-       control-<Home>
-              Scroll to first page of document.
+       control-<tab>
+              Next tab.
 
-       control-<End>
-              Scroll to last page of document.
+       control-shift-<tab>
+              Previous tab.
 
-       arrows Scroll the current page.
+       control-?
+              Help.
 
-       g      Activate the page number text field ("goto page").
+       alt-<left-arrow>
+              Go backward along the history path.
 
-       0      Set the zoom factor to 125%.
+       alt-<right-arrow>
+              Go forward along the history path.
 
-       +      Zoom in (increment the zoom factor by 1).
+       home   Go to the top left of current page.
 
-       -      Zoom out (decrement the zoom factor by 1).
+       control-<home>
+              Go to the first page.
 
-       z      Set the zoom factor to 'page' (fit page to window).
+       end    Go to the bottom right of current page.
 
-       w      Set the zoom factor to 'width' (fit page width to window).
+       control-<end>
+              Go to the last page.
 
-       alt-F  Toggle full-screen mode.
+       <space> or <PageDown>
+              Scroll  down  on the current page; if already at bottom, move to
+              next page.
 
-       q      Quit xpdf.
+       control-<PageDown> or control-<down-arrow>
+              Go to the next page.  If <ScrollLock> is active, this  maintains
+              the relative position on the page.
 
-WEB BROWSERS
-       If you want to run xpdf automatically  from  netscape  or  mosaic  (and
-       probably  other  browsers)  when you click on a link to a PDF file, you
-       need to edit (or create) the files .mime.types  and  .mailcap  in  your
-       home directory.  In .mime.types add the line:
+       <PageUp>
+              Scroll up on the current page; if already at top, move to previ-
+              ous page.
 
-              application/pdf pdf
+       control-<PageUp> or control-<up-arrow>
+              Go to the previous page.  If <ScrollLock> is active, this  main-
+              tains the relative position on the page.
 
-       In .mailcap add the lines:
+       <esc>  Exit full-screen mode.
 
-              # Use xpdf to view PDF files.
-              application/pdf; xpdf -q %s
+       arrows Scroll the current page.
 
-       Make sure that xpdf is on your executable search path.
+       g      Set keyboard focus to the page number entry box.
 
-       When  you click on a URL link in a PDF file, xpdf will execute the com-
-       mand specified by the  urlCommand  config  file  option,  replacing  an
-       occurrence  of  '%s'  with the URL.  For example, to call netscape with
-       the URL, add this line to your config file:
+       z      Set the zoom factor to 'page' (fit page to window).
 
-              urlCommand "netscape -remote 'openURL(%s)'"
+       w      Set the zoom factor to 'width' (fit page width to window).
 
+Full-screen mode
+       Xpdf  can  be  placed into full-screen mode via the -fullscreen command
+       line option,  the  'full  screen'  menu  item,  or  a  binding  to  the
+       fullScreenMode or toggleFullScreenModecommand.
+
+       Entering  full-screen  mode  automatically switches to single-page view
+       mode and to the fit-page zoom factor.
+
+       Full-screen mode can be exited via the default <esc>  key  binding,  or
+       via a binding to the windowMode or toggleFullScreenModecommand.
+
 COMMANDS
        Xpdf's key and mouse bindings are user-configurable, using the bind and
-       unbind  options  in  the config file (see xpdfrc(5)).  The bind command
-       allows you to bind a key or mouse button to a sequence of one  or  more
+       unbind commands in the config file (see xpdfrc(5)).  The  bind  command
+       allows  you  to bind a key or mouse button to a sequence of one or more
        commands.
 
-   Available Commands
        The following commands are supported:
 
-       gotoPage(page)
-              Go to the specified page.
+       about  Open the 'about' dialog.
 
-       gotoPageNoScroll(page)
-              Go to the specified page, with the current relative scroll posi-
-              tion.
+       blockSelectMode
+              Set block selection mode.  In this mode, the selection is a sim-
+              ple rectangle.  Any part of the page can be selected, regardless
+              of the content on the page.
 
-       gotoDest(dest)
-              Go to a named destination.
+       closeSidebar
+              Close the sidebar.
 
-       gotoLastPage
-              Go to the last page in the PDF file.
+       closeSidebarMoveResizeWin
+              Close the sidebar, resizing the window so that the document size
+              doesn't change, and moving the window so that the document stays
+              in the same place on the screen.
 
-       gotoLastPageNoScroll
-              Go to the last page in the PDF file, with the  current  relative
-              scroll position.
+       closeSidebarResizeWin
+              Close the sidebar, resizing the window so that the document size
+              doesn't change.
 
-       nextPage
-              Go to the next page.
+       closeTabOrQuit
+              Close the tab.  If this was the last open tab, close the window.
+              If this was the last window open, quit.
 
-       nextPageNoScroll
-              Go to the next page, with the current relative scroll position.
+       closeWindowOrQuit
+              Close the window.  If this was the last open window, quit.
 
-       prevPage
-              Go to the previous page.
+       continuousMode
+              Switch to continuous view mode.
 
-       prevPageNoScroll
-              Go  to the previous page, with the current relative scroll posi-
-              tion.
+       copy   Copy selected text to the clipboard.
 
-       pageUp Scroll up by one screenful.
+       endPan End a pan operation.
 
-       pageDown
-              Scroll down by one screenful.
+       endSelection
+              End a selection.
 
-       scrollLeft(n)
-              Scroll left by n pixels.
+       find   Set keyboard focus to the 'find' box.
 
-       scrollRight(n)
-              Scroll right by n pixels.
+       findFirst
+              Find the first occurrence of the search string.
 
-       scrollUp(n)
-              Scroll up by n pixels.
+       findNext
+              Find the next occurrence of the search string.
 
-       scrollDown(n)
-              Scroll down by n pixels.
+       findPrevious
+              Find the previous occurrence of the search string.
 
-       scrollUpPrevPage(n)
-              Scroll up by n pixels, moving to the previous page if  appropri-
-              ate.
+       focusToDocWin
+              Set keyboard focus to the main document window.
 
-       scrollDownPrevPage(n)
-              Scroll down by n pixels, moving to the next page if appropriate.
+       focusToPageNum
+              Set keyboard focus to the page number text box.
 
-       scrollToTopEdge
-              Scroll  to  the top edge of the current page, with no horizontal
-              movement.
+       followLink
+              Follow a hyperlink (does nothing if the  mouse  is  not  over  a
+              link).
 
-       scrollToBottomEdge
-              Scroll to the bottom edge of the current page, with no  horizon-
-              tal movement.
+       followLinkInNewTab
+              Follow a hyperlink, opening PDF files in a new tab (does nothing
+              if the mouse is not over a link).  For links to  non-PDF  files,
+              this command is identical to followLink.
 
-       scrollToLeftEdge
-              Scroll  to  the  left edge of the current page, with no vertical
-              movement.
+       followLinkInNewTabNoSel
+              Same  as followLinkInNewTab, but does nothing if there is a non-
+              empty selection.  (This is useful as a mouse button binding.)
 
-       scrollToRightEdge
-              Scroll to the right edge of the current page, with  no  vertical
-              movement.
+       followLinkInNewWin
+              Follow a hyperlink, opening PDF files  in  a  new  window  (does
+              nothing  if the mouse is not over a link).  For links to non-PDF
+              files, this command is identical to followLink.
 
-       scrollToTopLeft
-              Scroll to the top-left corner of the current page.
+       followLinkInNewWinNoSel
+              Same as followLinkInNewWin, but does nothing if there is a  non-
+              empty selection.  (This is useful as a mouse button binding.)
 
-       scrollToBottomRight
-              Scroll to the bottom-right corner of the current page.
+       followLinkNoSel
+              Same  as  followLink,  but  does nothing if there is a non-empty
+              selection.  (This is useful as a mouse button binding.)
 
-       goForward
-              Move forward along the history path.
+       fullScreenMode
+              Go to full-screen mode.
 
        goBackward
               Move backward along the history path.
 
-       zoomPercent(z)
-              Set the zoom factor to z%.
+       goForward
+              Move forward along the history path.
 
-       zoomFitPage
-              Set the zoom factor to fit-page.
+       gotoDest(dest)
+              Go to a named destination.
 
-       zoomFitWidth
-              Set the zoom factor to fit-width.
+       gotoLastPage
+              Go to the last page in the PDF file.
 
-       zoomIn Zoom in - go to the next higher zoom factor.
+       gotoPage(page)
+              Go to the specified page.
 
-       zoomOut
-              Zoom out - go the next lower zoom factor.
+       help   Open the help URL.
 
-       rotateCW
-              Rotate the page 90 degrees clockwise.
+       horizontalContinuousMode
+              Switch to horizontal continuous view mode.
 
-       rotateCCW
-              Rotate the page 90 degrees counterclockwise.
+       linearSelectMode
+              Set linear selection mode.  In this mode, the selection  follows
+              text.  Non-text regions cannot be selected.
 
-       setSelection(pg,ulx,uly,lrx,lry)
-              Set  the selection to the specified coordinates on the specified
-              page.
+       newTab Open an empty new tab.
 
-       continuousMode
-              Go to continuous view mode.
+       newWindow
+              Open an empty new window.
 
-       singlePageMode
-              Go to single-page view mode.
+       nextPage
+              Go to the next page.
 
-       toggleContinuousMode
-              Toggle between continuous and single page view modes.
+       nextPageNoScroll
+              Go to the next page, with the current relative scroll position.
 
-       fullScreenMode
-              Go to full-screen mode.
+       nextTab
+              Switch to the next tab.
 
-       windowMode
-              Go to window (non-full-screen) mode.
+       open   Open a PDF file in this tab, using the open dialog.
 
-       toggleFullScreenMode
-              Toggle between full-screen and window modes.
+       openErrorWindow
+              Open the error window.
 
-       open   Open a PDF file in this window, using the open dialog.
+       openSidebar
+              Open the sidebar.
 
-       openInNewWin
-              Open a PDF file in a new window, using the open dialog.
+       openSidebarMoveResizeWin
+              Open  the sidebar, resizing the window so that the document size
+              doesn't change, and moving the window so that the document stays
+              in the same place on the screen.
 
-       openFile(file)
-              Open a specified PDF file in this window.
+       openSidebarResizeWin
+              Open  the sidebar, resizing the window so that the document size
+              doesn't change.
 
-       openFileInNewWin(file)
-              Open a specified PDF file in a new window.
+       pageDown
+              Scroll down by one screenful.
 
-       openFileAtDest(file,dest)
-              Open a specified PDF file in this window and go to a named  des-
-              tination.
+       pageUp Scroll up by one screenful.
 
-       openFileAtDestInNewWin(file,dest)
-              Open a specified PDF file in a new window and go to a named des-
-              tination.
+       postPopupMenu
+              Display the popup menu.
 
-       reload Reload the current PDF file.
+       prevPage
+              Go to the previous page.
 
-       redraw Redraw the window.
+       prevPageNoScroll
+              Go to the previous page, with the current relative scroll  posi-
+              tion.
 
-       raise  Raise the window to the front.
+       prevTab
+              Switch to the previous tab.
 
-       closeWindow
-              Close the window.  If this was the last open window,  clear  the
-              window, but don't quit from Xpdf.
+       print  Open the 'print' dialog.
 
-       closeWindowOrQuit
-              Close  the  window.  If this was the last open window, quit from
-              Xpdf.
+       quit   Quit from xpdf.
 
+       reload Reload the current PDF file.
+
+       rotateCCW
+              Rotate the page 90 degrees counterclockwise.
+
+       rotateCW
+              Rotate the page 90 degrees clockwise.
+
        run(external-command-string)
-              Run an external command.  The following escapes are  allowed  in
+              Run  an  external command.  The following escapes are allowed in
               the command string:
 
                   %f => PDF file name (or an empty string if no
@@ -577,21 +525,26 @@
                   %k => y coordinate of the mouse pointer
                   %% => %
 
-              The  external  command  string will often contain spaces, so the
+              The external command string will often contain  spaces,  so  the
               whole command must be quoted in the xpdfrc file:
 
                   bind x "run(ls -l)"
 
 
-       openOutline
-              Open the outline pane.
+       saveAs Save PDF via a file requester.
 
-       closeOutline
-              Close the outline pane.
+       saveImage
+              Open the 'save image' dialog.
 
-       toggleOutline
-              Toggle the outline pane between open and closed.
+       scrollDown(n)
+              Scroll down by n pixels.
 
+       scrollDownPrevPage(n)
+              Scroll down by n pixels, moving to the next page if appropriate.
+
+       scrollLeft(n)
+              Scroll left by n pixels.
+
        scrollOutlineDown(n)
               Scroll the outline down by n increments.
 
@@ -598,149 +551,100 @@
        scrollOutlineUp(n)
               Scroll the outline up by n increments.
 
-       focusToDocWin
-              Set the keyboard focus to the main document window.
+       scrollRight(n)
+              Scroll right by n pixels.
 
-       focusToPageNum
-              Set the keyboard focus to the page number text box.
+       scrollToBottomEdge
+              Scroll  to the bottom edge of the current page, with no horizon-
+              tal movement.
 
-       find   Open the 'find' dialog.
+       scrollToBottomRight
+              Scroll to the bottom-right corner of the current page.
 
-       findNext
-              Finds the next occurrence of the search string (no dialog).
+       scrollToLeftEdge
+              Scroll to the left edge of the current page,  with  no  vertical
+              movement.
 
-       print  Open the 'print' dialog.
+       scrollToRightEdge
+              Scroll  to  the right edge of the current page, with no vertical
+              movement.
 
-       about  Open the 'about' dialog.
+       scrollToTopEdge
+              Scroll to the top edge of the current page, with  no  horizontal
+              movement.
 
-       quit   Quit from xpdf.
+       scrollToTopLeft
+              Scroll to the top-left corner of the current page.
 
-       The following commands depend on the current mouse position:
+       scrollUp(n)
+              Scroll up by n pixels.
 
-       startSelection
-              Start a selection, which will be extended as the mouse moves.
+       scrollUpPrevPage(n)
+              Scroll  up by n pixels, moving to the previous page if appropri-
+              ate.
 
-       endSelection
-              End a selection.
+       setSelection(pg,ulx,uly,lrx,lry)
+              Set the selection to the specified coordinates on the  specified
+              page.
 
-       startPan
-              Start a pan, which will scroll the document as the mouse moves
+       sideBySideContinuousMode
+              Switch to side-by-side continuous view mode.
 
-       endPan End a pan.
+       sideBySideSingleMode
+              Switch to side-by-side two-page view mode.
 
-       postPopupMenu
-              Display the popup menu.
+       singlePageMode
+              Switch to single-page view mode.
 
-       followLink
-              Follow a hyperlink (does nothing if the  mouse  is  not  over  a
-              link).
+       startPan
+              Start  a pan operation at the current mouse position, which will
+              scroll the document as the mouse moves.
 
-       followLinkInNewWin
-              Follow  a  hyperlink,  opening  PDF  files in a new window (does
-              nothing if the mouse is not over a link).  For links to  non-PDF
-              files, this command is identical to followLink.
+       startSelection
+              Start a selection at the current mouse position, which  will  be
+              extended as the mouse moves.
 
-       followLinkNoSel
-              Same  as  followLink,  but  does nothing if there is a non-empty
-              selection.  (This is useful as a mouse button binding.)
+       toggleContinuousMode
+              Toggle between continuous and single page view modes.
 
-       followLinkInNewWinNoSel
-              Same as followLinkInNewWin, but does nothing if there is a  non-
-              empty selection.  (This is useful as a mouse button binding.)
+       toggleFullScreenMode
+              Toggle between full-screen and window modes.
 
-   Default Bindings
-       The default mouse bindings are as follows:
+       toggleSelectMode
+              Toggle between block and linear selection mode.
 
-           bind mousePress1    any         startSelection
-           bind mouseRelease1  any         endSelection followLinkNoSel
-           bind mousePress2    any         startPan
-           bind mouseRelease2  any         endPan
-           bind mousePress3    any         postPopupMenu
-           bind mousePress4    any         scrollUpPrevPage(16)
-           bind mousePress5    any         scrollDownNextPage(16)
-           bind mousePress6    any         scrollLeft(16)
-           bind mousePress7    any         scrollRight(16)
+       toggleSidebar
+              Toggle the sidebar between open and closed.
 
-       The default key bindings are as follows:
+       toggleSidebarMoveResizeWin
+              Toggle  the sidebar between open and closed, resizing the window
+              so that the document size doesn't change, and moving the  window
+              so that the document stays in the same place on the screen.
 
-           bind ctrl-home      any         gotoPage(1)
-           bind home           any         scrollToTopLeft
-           bind ctrl-end       any         gotoLastPage
-           bind end            any         scrollToBottomRight
-           bind pgup           any         pageUp
-           bind backspace      any         pageUp
-           bind delete         any         pageUp
-           bind pgdn           any         pageDown
-           bind space          any         pageDown
-           bind left           any         scrollLeft(16)
-           bind right          any         scrollRight(16)
-           bind up             any         scrollUp(16)
-           bind down           any         scrollDown(16)
-           bind o              any         open
-           bind O              any         open
-           bind r              any         reload
-           bind R              any         reload
-           bind f              any         find
-           bind F              any         find
-           bind ctrl-f         any         find
-           bind ctrl-g         any         findNext
-           bind ctrl-p         any         print
-           bind n              scrLockOff  nextPage
-           bind N              scrLockOff  nextPage
-           bind n              scrLockOn   nextPageNoScroll
-           bind N              scrLockOn   nextPageNoScroll
-           bind p              scrLockOff  prevPage
-           bind P              scrLockOff  prevPage
-           bind p              scrLockOn   prevPageNoScroll
-           bind P              scrLockOn   prevPageNoScroll
-           bind v              any         goForward
-           bind b              any         goBackward
-           bind g              any         focusToPageNum
-           bind 0              any         zoomPercent(125)
-           bind +              any         zoomIn
-           bind -              any         zoomOut
-           bind z              any         zoomFitPage
-           bind w              any         zoomFitWidth
-           bind alt-f          any         toggleFullScreenMode
-           bind ctrl-l         any         redraw
-           bind ctrl-w         any         closeWindowOrQuit
-           bind ?              any         about
-           bind q              any         quit
-           bind Q              any         quit
+       toggleSidebarResizeWin
+              Toggle  the sidebar between open and closed, resizing the window
+              so that the document size doesn't change.
 
-       Previous  versions  of  xpdf  included a "viKeys" X resource.  It is no
-       longer available, but the following bindings are equivalent:
+       windowMode
+              Go to window (non-full-screen) mode.
 
-           bind h any scrollLeft(16)
-           bind l any scrollRight(16)
-           bind k any scrollUp(16)
-           bind j any scrollDown(16)
+       zoomFitPage
+              Set the zoom factor to fit-page.
 
+       zoomFitWidth
+              Set the zoom factor to fit-width.
 
-REMOTE SERVER MODE
-       Xpdf can be started in remote server mode by specifying a  server  name
-       (in addition to the file name and page number).  For example:
+       zoomIn Zoom in - go to the next higher zoom factor.
 
-              xpdf -remote myServer file.pdf
+       zoomOut
+              Zoom out - go the next lower zoom factor.
 
-       If  there  is  currently  no  xpdf running in server mode with the name
-       'myServer', a new xpdf window will be opened.  If another command:
+       zoomPercent(z)
+              Set the zoom factor to z%.
 
-              xpdf -remote myServer another.pdf 9
+       zoomToSelection
+              Zoom to the current selection.
 
-       is issued, a new copy of xpdf will not be started.  Instead, the  first
-       xpdf  (the server) will load another.pdf and display page nine.  If the
-       file name is the same:
-
-              xpdf -remote myServer another.pdf 4
-
-       the xpdf server will simply display the specified page.
-
-       The -raise option tells the server to raise its window; it can be spec-
-       ified with or without a file name and page number.
-
-       The -quit option tells the server to close its window and exit.
-
 EXIT CODES
        The Xpdf tools use the following exit codes:
 
@@ -755,14 +659,14 @@
        99     Other error.
 
 AUTHOR
-       The  xpdf  software  and  documentation are copyright 1996-2014 Glyph &
+       The xpdf software and documentation are  copyright  1996-2017  Glyph  &
        Cog, LLC.
 
 SEE ALSO
        pdftops(1), pdftotext(1), pdftohtml(1), pdfinfo(1), pdffonts(1), pdfde-
        tach(1), pdftoppm(1), pdftopng(1), pdfimages(1), xpdfrc(5)
-       http://www.foolabs.com/xpdf/
+       http://www.xpdfreader.com/
 
 
 
-                                  28 May 2014                          xpdf(1)
+                                  10 Aug 2017                          xpdf(1)

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/doc/xpdfrc.5
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/doc/xpdfrc.5	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/doc/xpdfrc.5	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,7 +1,7 @@
-.\" Copyright 2002-2014 Glyph & Cog, LLC
-.TH xpdfrc 5 "28 May 2014"
+.\" Copyright 2002-2017 Glyph & Cog, LLC
+.TH xpdfrc 5 "10 Aug 2017"
 .SH NAME
-xpdfrc \- configuration file for Xpdf tools (version 3.04)
+xpdfrc \- configuration file for Xpdf tools (version 4.00)
 .SH DESCRIPTION
 All of the Xpdf tools read a single configuration file.  If you have a
 .I .xpdfrc
@@ -31,114 +31,6 @@
 directly into the parent config file in place of the
 .I include
 command.  Config files can be nested arbitrarily deeply.
-.SH CHARACTER MAPPING
-.TP
-.BI nameToUnicode " map\-file"
-Specifies a file with the mapping from character names to Unicode.
-This is used to handle PDF fonts that have valid encodings but no
-ToUnicode entry.  Each line of a nameToUnicode file looks like this:
-
-.I "    " hex\-string name
-
-The
-.I hex\-string
-is the Unicode (UCS-2) character index, and
-.I name
-is the corresponding character name.  Multiple nameToUnicode files can
-be used; if a character name is given more than once, the code in the
-last specified file is used.  There is a built-in default
-nameToUnicode table with all of Adobe's standard character names.
-.TP
-.BI cidToUnicode " registry\-ordering map\-file"
-Specifies the file with the mapping from character collection to
-Unicode.  Each line of a cidToUnicode file represents one character:
-
-.I "    " hex\-string
-
-The
-.I hex\-string
-is the Unicode (UCS-2) index for that character.  The first line maps
-CID 0, the second line CID 1, etc.  File size is determined by size of
-the character collection.  Only one file is allowed per character
-collection; the last specified file is used.  There are no built-in
-cidToUnicode mappings.
-.TP
-.BI unicodeToUnicode " font\-name\-substring map\-file"
-This is used to work around PDF fonts which have incorrect Unicode
-information.  It specifies a file which maps from the given
-(incorrect) Unicode indexes to the correct ones.  The mapping will be
-used for any font whose name contains
-.IR font\-name\-substring .
-Each line of a unicodeToUnicode file represents one Unicode character:
-
-.RI "    " in\-hex " " out\-hex1 " " out\-hex2 " ..."
-
-The
-.I in\-hex
-field is an input (incorrect) Unicode index, and the rest of the
-fields are one or more output (correct) Unicode indexes.  Each
-occurrence of
-.I in\-hex
-will be converted to the specified output sequence.
-.TP
-.BI unicodeMap " encoding\-name map\-file"
-Specifies the file with mapping from Unicode to
-.IR encoding\-name .
-These encodings are used for text output (see below).  Each line of a
-unicodeMap file represents a range of one or more Unicode characters
-which maps linearly to a range in the output encoding:
-.nf
-
-.I "    " in\-start\-hex in\-end\-hex out\-start\-hex
-
-.fi
-Entries for single characters can be abbreviated to:
-.nf
-
-.I "    " in\-hex out\-hex
-
-.fi
-The
-.I in\-start\-hex
-and
-.I in\-end\-hex
-fields (or the single
-.I in\-hex
-field) specify the Unicode range.  The
-.I out\-start\-hex
-field (or the
-.I out\-hex
-field) specifies the start of the output encoding range.  The length
-of the
-.I out\-start\-hex
-(or
-.IR out\-hex )
-string determines the length of the output characters (e.g., UTF-8
-uses different numbers of bytes to represent characters in different
-ranges).  Entries must be given in increasing Unicode order.  Only one
-file is allowed per encoding; the last specified file is used.  The
-.IR Latin1 ,
-.IR ASCII7 ,
-.IR Symbol ,
-.IR ZapfDingbats ,
-.IR UTF-8 ,
-and
-.I UCS-2
-encodings are predefined.
-.TP
-.BI cMapDir " registry\-ordering dir"
-Specifies a search directory,
-.IR dir ,
-for CMaps for the
-.I registry\-ordering
-character collection.  There can be multiple directories for a
-particular collection.  There are no default CMap directories.
-.TP
-.BI toUnicodeDir " dir"
-Specifies a search directory,
-.IR dir ,
-for ToUnicode CMaps.  There can be multiple ToUnicode directories.
-There are no default ToUnicode directories.
 .SH GENERAL FONT CONFIGURATION
 .TP
 .BI fontFile " PDF\-font\-name font\-file"
@@ -195,7 +87,7 @@
 is used (without embedding) in a PDF file, it will be translated to
 the PostScript font
 .IR PS\-font\-name ,
-which is assumbed to be resident in the printer.  The writing mode
+which is assumed to be resident in the printer.  The writing mode
 must be either \'H' for horizontal or \'V' for vertical.  The resident
 font is assumed to use the specified encoding (which must have been
 defined with the unicodeMap command).
@@ -208,7 +100,7 @@
 writing mode is used (without embedding) in a PDF file, the PostScript
 font,
 .IR PS\-font\-name ,
-is substituted for it.  The substituted font is assumbed to be
+is substituted for it.  The substituted font is assumed to be
 resident in the printer.  The writing mode must be either \'H' for
 horizontal or \'V' for vertical.  The resident font is assumed to use
 the specified encoding (which must have been defined with the
@@ -268,7 +160,7 @@
 .TP
 .BR psExpandSmaller " yes | no"
 If set to "yes", PDF pages smaller than the PostScript imageable area
-are expanded to fill the imageable area.  Otherwise, no scalling is
+are expanded to fill the imageable area.  Otherwise, no scaling is
 done on smaller pages.  This defaults to "no".
 .TP
 .BR psShrinkLarger " yes | no"
@@ -287,7 +179,7 @@
 pagedevice entry.  This tells duplex-capable printers to enable
 duplexing.  This defaults to "no".
 .TP
-.BR psLevel " level1 | level1sep | level2 | level2sep | level3 | level3Sep"
+.BR psLevel " level1 | level1sep | level2 | level2gray | level2sep | level3 | level3gray | level3Sep"
 Sets the PostScript level to generate.  This defaults to "level2".
 .TP
 .BR psPreload " yes | no"
@@ -341,6 +233,12 @@
 If set to "yes", all PostScript output will be rasterized.  This
 defaults to "no".
 .TP
+.BR psNeverRasterize " yes | no"
+If set to "yes", PostScript output will never be rasterized.  This
+will likely result in incorrect output for PDF files that use
+transparency.  (If both psAlwaysRasterize and psNeverRasterize are set
+to "yes", the psAlwaysRasterize setting wins.)  This defaults to "no".
+.TP
 .BI psFile " file\-or\-command"
 Sets the default PostScript file or print command for xpdf.  Commands
 start with a \'|' character; anything else is a file.  If the file
@@ -350,7 +248,7 @@
 .TP
 .BI fontDir " dir"
 See the description above, in the DISPLAY FONTS section.
-.SH TEXT CONTROL
+.SH TEXT CONTROL AND CHARACTER MAPPING
 .TP
 .BI textEncoding " encoding\-name"
 Sets the encoding to use for text output.  (This can be overridden
@@ -383,25 +281,139 @@
 characters after the first 50000 per page, avoiding extremely slow run
 times for PDF files that use special fonts to do shading or
 cross-hatching.  This defaults to "yes".
-.SH MISCELLANEOUS SETTINGS
 .TP
-.BR initialZoom " \fIpercentage\fR | page | width"
-Sets the initial zoom factor.  A number specifies a zoom percentage,
-where 100 means 72 dpi.  You may also specify \'page', to fit the page
-to the window size, or \'width', to fit the page width to the window
-width.
+.BI nameToUnicode " map\-file"
+Specifies a file with the mapping from character names to Unicode.
+This is used to handle PDF fonts that have valid encodings but no
+ToUnicode entry.  Each line of a nameToUnicode file looks like this:
+
+.I "    " hex\-string name
+
+The
+.I hex\-string
+is the Unicode (UCS-2) character index, and
+.I name
+is the corresponding character name.  Multiple nameToUnicode files can
+be used; if a character name is given more than once, the code in the
+last specified file is used.  There is a built-in default
+nameToUnicode table with all of Adobe's standard character names.
 .TP
-.BR continuousView " yes | no"
-If set to "yes", xpdf will start in continuous view mode, i.e., with
-one vertical screoll bar for the whole document.  This defaults to
-"no".
+.BI cidToUnicode " registry\-ordering map\-file"
+Specifies the file with the mapping from character collection to
+Unicode.  Each line of a cidToUnicode file represents one character:
+
+.I "    " hex\-string
+
+The
+.I hex\-string
+is the Unicode (UCS-2) index for that character.  The first line maps
+CID 0, the second line CID 1, etc.  File size is determined by size of
+the character collection.  Only one file is allowed per character
+collection; the last specified file is used.  There are no built-in
+cidToUnicode mappings.
 .TP
-.BR enableFreeType " yes | no"
-Enables or disables use of FreeType (a TrueType / Type 1 font
-rasterizer).  This is only relevant if the Xpdf tools were built with
-FreeType support.  ("enableFreeType" replaces the old
-"freetypeControl" option.)  This option defaults to "yes".
+.BI unicodeToUnicode " font\-name\-substring map\-file"
+This is used to work around PDF fonts which have incorrect Unicode
+information.  It specifies a file which maps from the given
+(incorrect) Unicode indexes to the correct ones.  The mapping will be
+used for any font whose name contains
+.IR font\-name\-substring .
+Each line of a unicodeToUnicode file represents one Unicode character:
+
+.RI "    " in\-hex " " out\-hex1 " " out\-hex2 " ..."
+
+The
+.I in\-hex
+field is an input (incorrect) Unicode index, and the rest of the
+fields are one or more output (correct) Unicode indexes.  Each
+occurrence of
+.I in\-hex
+will be converted to the specified output sequence.
 .TP
+.BI unicodeMap " encoding\-name map\-file"
+Specifies the file with mapping from Unicode to
+.IR encoding\-name .
+These encodings are used for text output (see below).  Each line of a
+unicodeMap file represents a range of one or more Unicode characters
+which maps linearly to a range in the output encoding:
+.nf
+
+.I "    " in\-start\-hex in\-end\-hex out\-start\-hex
+
+.fi
+Entries for single characters can be abbreviated to:
+.nf
+
+.I "    " in\-hex out\-hex
+
+.fi
+The
+.I in\-start\-hex
+and
+.I in\-end\-hex
+fields (or the single
+.I in\-hex
+field) specify the Unicode range.  The
+.I out\-start\-hex
+field (or the
+.I out\-hex
+field) specifies the start of the output encoding range.  The length
+of the
+.I out\-start\-hex
+(or
+.IR out\-hex )
+string determines the length of the output characters (e.g., UTF-8
+uses different numbers of bytes to represent characters in different
+ranges).  Entries must be given in increasing Unicode order.  Only one
+file is allowed per encoding; the last specified file is used.  The
+.IR Latin1 ,
+.IR ASCII7 ,
+.IR Symbol ,
+.IR ZapfDingbats ,
+.IR UTF-8 ,
+and
+.I UCS-2
+encodings are predefined.
+.TP
+.BI cMapDir " registry\-ordering dir"
+Specifies a search directory,
+.IR dir ,
+for CMaps for the
+.I registry\-ordering
+character collection.  There can be multiple directories for a
+particular collection.  There are no default CMap directories.
+.TP
+.BI toUnicodeDir " dir"
+Specifies a search directory,
+.IR dir ,
+for ToUnicode CMaps.  There can be multiple ToUnicode directories.
+There are no default ToUnicode directories.
+.TP
+.BI mapNumericCharNames " yes | no"
+If set to "yes", the Xpdf tools will attempt to map various numeric
+character names sometimes used in font subsets.  In some cases this
+leads to usable text, and in other cases it leads to gibberish --
+there is no way for Xpdf to tell.  This defaults to "yes".
+.TP
+.BI mapUnknownCharNames " yes | no"
+If set to "yes", and mapNumericCharNames is set to "no", the Xpdf
+tools will apply a simple pass-through mapping (Unicode index =
+character code) for all unrecognized glyph names.  (For CID fonts,
+setting mapNumericCharNames to "no" is unnecessary.)  In some cases,
+this leads to usable text, and in other cases it leads to gibberish --
+there is no way for Xpdf to tell.  This defaults to "no".
+.TP
+.BI mapExtTrueTypeFontsViaUnicode " yes | no"
+When rasterizing text using an external TrueType font, there are two
+options for handling character codes.  If
+mapExtTrueTypeFontsViaUnicode is set to "yes", Xpdf will use the font
+encoding/ToUnicode info to map character codes to Unicode, and then
+use the font's Unicode cmap to map Unicode to GIDs.  If
+mapExtTrueTypeFontsViaUnicode is set to "no", Xpdf will assume the
+character codes are GIDs (i.e., use an identity mapping).  This
+defaults to "yes".
+.SH RASTERIZER SETTINGS
+.TP
 .BR enableFreeType " yes | no"
 Enables or disables use of FreeType (a TrueType / Type 1 font
 rasterizer).  This is only relevant if the Xpdf tools were built with
@@ -428,11 +440,15 @@
 this is "no", printed bitmaps will not be antialiased.  This defaults
 to "no".
 .TP
-.BR strokeAdjust " yes | no"
-Enables or disables stroke adjustment.  Stroke adjustment moves
-horizontal and vertical lines by up to half a pixel to make them look
-"cleaner" when vector anti-aliasing is enabled.  This defaults to
-"yes".
+.BR strokeAdjust " yes | no | cad"
+Sets the stroke adjustment mode.  If set to "no", no stroke adjustment
+will be done.  If set to "yes", normal stroke adjustment will be done:
+horizontal and vertical lines will be moved by up to half a pixel to
+make them look cleaner when vector anti-aliasing is enabled.  If set
+to "cad", a slightly different stroke adjustment algorithm will be
+used to ensure that lines of the same original width will always have
+the same adjusted width (at the expense of allowing gaps and overlaps
+between adjacent lines).  This defaults to "yes".
 .TP
 .BR screenType " dispersed | clustered | stochasticClustered"
 Sets the halftone screen type, which will be used when generating a
@@ -474,15 +490,76 @@
 rasterization to handle transparency).  The default value is 0 (no
 minimum).
 .TP
-.BI drawAnnotations " yes | no"
-If set to "no", annotations will not be drawn or printed.  The default
-value is "yes".
+.BI enablePathSimplification " yes | no"
+If set to "yes", simplify paths by removing points where it won't make
+a significant difference to the shape.  The default value is "no".
 .TP
 .BI overprintPreview " yes | no"
 If set to "yes", generate overprint preview output, honoring the
 OP/op/OPM settings in the PDF file.  Ignored for non-CMYK output.  The
 default value is "no".
+.SH VIEWER SETTINGS
+These settings only apply to the Xpdf GUI PDF viewer.
 .TP
+.BR initialZoom " \fIpercentage\fR | page | width"
+Sets the initial zoom factor.  A number specifies a zoom percentage,
+where 100 means 72 dpi.  You may also specify \'page', to fit the page
+to the window size, or \'width', to fit the page width to the window
+width.
+.TP
+.BI defaultFitZoom " percentage"
+If xpdf is started with fit-page or fit-width zoom and no window
+geometry, it will calculate a desired window size based on the PDF
+page size and this defaultFitZoom value.  I.e., the window size will
+be chosen such that exactly one page will fit in the window at this
+zoom factor (which must be a percentage).  The default value is
+based on the screen resolution.
+.TP
+.BI initialSidebarState " yes | no"
+If set to "yes", xpdf opens with the sidebar (tabs, outline, etc.)
+visible.  If set to "no", xpdf opens with the sidebar collapsed.  The
+default is "no".
+.TP
+.BI paperColor " color"
+Set the "paper color", i.e., the background of the page display.  The
+color can be #RRGGBB (hexadecimal) or a named color.  This option will
+not work well with PDF files that do things like filling in white
+behind the text.
+.TP
+.BI matteColor " color"
+Set the matte color, i.e., the color used for background outside the
+actual page area.  The color can be #RRGGBB (hexadecimal) or a named
+color.
+.TP
+.BI fullScreenMatteColor " color"
+Set the matte color for full-screen mode.  The color can be #RRGGBB
+(hexadecimal) or a named color.
+.TP
+.BI popupMenuCmd " title command ..."
+Add a command to the popup menu.
+.I Title
+is the text to be displayed in the menu.
+.I Command
+is an Xpdf command (see the COMMANDS section of the
+.BR xpdf (1)
+man page for details).  Multiple commands are separated by whitespace.
+.TP
+.BI maxTileWidth " pixels"
+Set the maximum width of tiles to be used by xpdf when rasterizing
+pages.  This defaults to 1500.
+.TP
+.BI maxTileHeight " pixels"
+Set the maximum height of tiles to be used by xpdf when rasterizing
+pages.  This defaults to 1500.
+.TP
+.BI tileCacheSize " tiles"
+Set the maximum number of tiles to be cached by xpdf when rasterizing
+pages.  This defaults to 10.
+.TP
+.BI workerThreads " numThreads"
+Set the number of worker threads to be used by xpdf when rasterizing
+pages.  This defaults to 1.
+.TP
 .BI launchCommand " command"
 Sets the command executed when you click on a "launch"-type link.  The
 intent is for the command to be a program/script which determines the
@@ -492,45 +569,11 @@
 this is unset, and Xpdf will simply try to execute the file (after
 prompting the user).
 .TP
-.BI urlCommand " command"
-Sets the command executed when you click on a URL link.  The string
-"%s" will be replaced with the URL.  (See the example below.)  This
-has no default value.
-.TP
 .BI movieCommand " command"
 Sets the command executed when you click on a movie annotation.  The
 string "%s" will be replaced with the movie file name.  This has no
 default value.
 .TP
-.BI mapNumericCharNames " yes | no"
-If set to "yes", the Xpdf tools will attempt to map various numeric
-character names sometimes used in font subsets.  In some cases this
-leads to usable text, and in other cases it leads to gibberish --
-there is no way for Xpdf to tell.  This defaults to "yes".
-.TP
-.BI mapUnknownCharNames " yes | no"
-If set to "yes", and mapNumericCharNames is set to "no", the Xpdf
-tools will apply a simple pass-through mapping (Unicode index =
-character code) for all unrecognized glyph names.  (For CID fonts,
-setting mapNumericCharNames to "no" is unnecessary.)  In some cases,
-this leads to usable text, and in other cases it leads to gibberish --
-there is no way for Xpdf to tell.  This defaults to "no".
-.TP
-.BI mapExtTrueTypeFontsViaUnicode " yes | no"
-When rasterizing text using an external TrueType font, there are two
-options for handling character codes.  If
-mapExtTrueTypeFontsViaUnicode is set to "yes", Xpdf will use the font
-encoding/ToUnicode info to map character codes to Unicode, and then
-use the font's Unicode cmap to map Unicode to GIDs.  If
-mapExtTrueTypeFontsViaUnicode is set to "no", Xpdf will assume the
-character codes are GIDs (i.e., use an identity mapping).  This
-defaults to "yes".
-.TP
-.BI enableXFA " yes | no"
-If set to "yes", an XFA form (if present) will be rendered in place of
-an AcroForm.  If "no", an XFA form will never be rendered.  This
-defaults to "yes".
-.TP
 .BI bind " modifiers-key context command ..."
 Add a key or mouse button binding.
 .I Modifiers
@@ -551,6 +594,7 @@
     return
     enter
     backspace
+    esc
     insert
     delete
     home
@@ -561,6 +605,7 @@
     f1 .. f35                       (function keys)
     mousePress1 .. mousePress7      (mouse buttons)
     mouseRelease1 .. mouseRelease7  (mouse buttons)
+    mouseClick1 .. mouseClick7      (mouse buttons)
 
 .fi
 .I Context
@@ -607,7 +652,21 @@
 useful to remove default key bindings before establishing new ones
 (e.g., if the default key binding is given for "any" context, and you
 want to create new key bindings for multiple contexts).
+.SH MISCELLANEOUS SETTINGS
 .TP
+.BI drawAnnotations " yes | no"
+If set to "no", annotations will not be drawn or printed.  The default
+value is "yes".
+.TP
+.BI drawFormFields " yes | no"
+If set to "no", form fields will not be drawn or printed.  The default
+value is "yes".
+.TP
+.BI enableXFA " yes | no"
+If set to "yes", an XFA form (if present) will be rendered in place of
+an AcroForm.  If "no", an XFA form will never be rendered.  This
+defaults to "yes".
+.TP
 .BI printCommands " yes | no"
 If set to "yes", drawing commands are printed as they're executed
 (useful for debugging).  This defaults to "no".
@@ -680,7 +739,7 @@
 This is the user's configuration file.  If it exists, it will be read
 in place of the system-wide file.
 .SH AUTHOR
-The Xpdf software and documentation are copyright 1996-2014 Glyph &
+The Xpdf software and documentation are copyright 1996-2017 Glyph &
 Cog, LLC.
 .SH "SEE ALSO"
 .BR xpdf (1),
@@ -694,4 +753,4 @@
 .BR pdftopng (1),
 .BR pdfimages (1)
 .br
-.B http://www.foolabs.com/xpdf/
+.B http://www.xpdfreader.com/

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/doc/xpdfrc.cat
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/doc/xpdfrc.cat	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/doc/xpdfrc.cat	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,9 +1,9 @@
-xpdfrc(5)                                                            xpdfrc(5)
+xpdfrc(5)                     File Formats Manual                    xpdfrc(5)
 
 
 
 NAME
-       xpdfrc - configuration file for Xpdf tools (version 3.04)
+       xpdfrc - configuration file for Xpdf tools (version 4.00)
 
 DESCRIPTION
        All  of the Xpdf tools read a single configuration file.  If you have a
@@ -30,85 +30,6 @@
               into the parent config file in place  of  the  include  command.
               Config files can be nested arbitrarily deeply.
 
-CHARACTER MAPPING
-       nameToUnicode map-file
-              Specifies  a  file with the mapping from character names to Uni-
-              code.  This is used to handle PDF fonts that have  valid  encod-
-              ings  but no ToUnicode entry.  Each line of a nameToUnicode file
-              looks like this:
-
-                   hex-string name
-
-              The hex-string is the Unicode (UCS-2) character index, and  name
-              is  the  corresponding  character  name.  Multiple nameToUnicode
-              files can be used; if a character name is given more than  once,
-              the  code in the last specified file is used.  There is a built-
-              in default nameToUnicode table  with  all  of  Adobe's  standard
-              character names.
-
-       cidToUnicode registry-ordering map-file
-              Specifies the file with the mapping from character collection to
-              Unicode.  Each line of a cidToUnicode file represents one  char-
-              acter:
-
-                   hex-string
-
-              The  hex-string is the Unicode (UCS-2) index for that character.
-              The first line maps CID 0, the second line  CID  1,  etc.   File
-              size  is  determined  by size of the character collection.  Only
-              one file is allowed per character collection; the last specified
-              file is used.  There are no built-in cidToUnicode mappings.
-
-       unicodeToUnicode font-name-substring map-file
-              This  is used to work around PDF fonts which have incorrect Uni-
-              code information.  It specifies a file which maps from the given
-              (incorrect)  Unicode  indexes  to the correct ones.  The mapping
-              will be used for any font  whose  name  contains  font-name-sub-
-              string.   Each  line  of  a unicodeToUnicode file represents one
-              Unicode character:
-
-                  in-hex out-hex1 out-hex2 ...
-
-              The in-hex field is an input (incorrect) Unicode index, and  the
-              rest  of  the  fields  are  one or more output (correct) Unicode
-              indexes.  Each occurrence of in-hex will  be  converted  to  the
-              specified output sequence.
-
-       unicodeMap encoding-name map-file
-              Specifies  the  file with mapping from Unicode to encoding-name.
-              These encodings are used for text output (see below).  Each line
-              of  a  unicodeMap file represents a range of one or more Unicode
-              characters which maps linearly to a range in the  output  encod-
-              ing:
-
-                   in-start-hex in-end-hex out-start-hex
-
-              Entries for single characters can be abbreviated to:
-
-                   in-hex out-hex
-
-              The  in-start-hex  and  in-end-hex  fields (or the single in-hex
-              field) specify the Unicode range.  The out-start-hex  field  (or
-              the  out-hex  field)  specifies the start of the output encoding
-              range.  The length of  the  out-start-hex  (or  out-hex)  string
-              determines the length of the output characters (e.g., UTF-8 uses
-              different numbers of bytes to represent characters in  different
-              ranges).   Entries  must  be  given in increasing Unicode order.
-              Only one file is allowed per encoding; the last  specified  file
-              is  used.   The Latin1, ASCII7, Symbol, ZapfDingbats, UTF-8, and
-              UCS-2 encodings are predefined.
-
-       cMapDir registry-ordering dir
-              Specifies a search  directory,  dir,  for  CMaps  for  the  reg-
-              istry-ordering  character  collection.   There  can  be multiple
-              directories for a particular collection.  There are  no  default
-              CMap directories.
-
-       toUnicodeDir dir
-              Specifies  a  search directory, dir, for ToUnicode CMaps.  There
-              can be multiple ToUnicode directories.   There  are  no  default
-              ToUnicode directories.
-
 GENERAL FONT CONFIGURATION
        fontFile PDF-font-name font-file
               Maps  a  PDF font, PDF-font-name, to a font for display or Post-
@@ -149,17 +70,17 @@
        psResidentFont16 PDF-font-name wMode PS-font-name encoding
               When the 16-bit (CID) font PDF-font-name with writing mode wMode
               is used (without embedding) in a PDF file, it will be translated
-              to  the  PostScript  font  PS-font-name, which is assumbed to be
-              resident in the printer.  The writing mode must  be  either  'H'
-              for  horizontal  or  'V'  for  vertical.   The  resident font is
-              assumed to use the specified  encoding  (which  must  have  been
-              defined with the unicodeMap command).
+              to the PostScript font PS-font-name, which is assumed to be res-
+              ident in the printer.  The writing mode must be either  'H'  for
+              horizontal or 'V' for vertical.  The resident font is assumed to
+              use the specified encoding (which must have  been  defined  with
+              the unicodeMap command).
 
        psResidentFontCC registry-ordering wMode PS-font-name encoding
               When  a  16-bit (CID) font using the registry-ordering character
               collection and wMode writing mode is used (without embedding) in
               a  PDF  file,  the PostScript font, PS-font-name, is substituted
-              for it.  The substituted font is assumbed to be resident in  the
+              for it.  The substituted font is assumed to be resident  in  the
               printer.   The writing mode must be either 'H' for horizontal or
               'V' for vertical.  The resident font is assumed to use the spec-
               ified encoding (which must have been defined with the unicodeMap
@@ -219,7 +140,7 @@
        psExpandSmaller yes | no
               If set to "yes", PDF pages smaller than the PostScript imageable
               area are expanded to fill the  imageable  area.   Otherwise,  no
-              scalling is done on smaller pages.  This defaults to "no".
+              scaling is done on smaller pages.  This defaults to "no".
 
        psShrinkLarger yes | no
               If  set  to  yes, PDF pages larger than the PostScript imageable
@@ -237,47 +158,48 @@
               pagedevice  entry.  This tells duplex-capable printers to enable
               duplexing.  This defaults to "no".
 
-       psLevel level1 | level1sep | level2 | level2sep | level3 | level3Sep
+       psLevel level1 | level1sep | level2 | level2gray | level2sep | level3 |
+       level3gray | level3Sep
               Sets  the  PostScript  level  to  generate.   This  defaults  to
               "level2".
 
        psPreload yes | no
-              If  set  to "yes", PDF forms are converted to PS procedures, and
-              image data is preloaded.  This uses more  memory  in  the  Post-
+              If set to "yes", PDF forms are converted to PS  procedures,  and
+              image  data  is  preloaded.   This uses more memory in the Post-
               Script interpreter, but generates significantly smaller PS files
               in situations where, e.g., the same image is drawn on every page
               of a long document.  This defaults to "no".
 
        psOPI yes | no
-              If  set  to  "yes",  generates  PostScript  OPI comments for all
-              images and forms which have OPI  information.   This  option  is
+              If set to "yes",  generates  PostScript  OPI  comments  for  all
+              images  and  forms  which  have OPI information.  This option is
               only available if the Xpdf tools were compiled with OPI support.
               This defaults to "no".
 
        psASCIIHex yes | no
-              If set to "yes", the ASCIIHexEncode filter will be used  instead
+              If  set to "yes", the ASCIIHexEncode filter will be used instead
               of ASCII85Encode for binary data.  This defaults to "no".
 
        psLZW yes | no
-              If  set to "yes", the LZWEncode filter will be used for lossless
+              If set to "yes", the LZWEncode filter will be used for  lossless
               compression in PostScript output; if set to "no", the RunLength-
-              Encode  filter  will be used instead.  LZW generates better com-
-              pression (smaller PS files), but may not be  supported  by  some
+              Encode filter will be used instead.  LZW generates  better  com-
+              pression  (smaller  PS  files), but may not be supported by some
               printers.  This defaults to "yes".
 
        psUncompressPreloadedImages yes | no
-              If  set  to  "yes", all preloaded images in PS files will uncom-
+              If set to "yes", all preloaded images in PS  files  will  uncom-
               pressed.  If set to "no", the original compressed images will be
-              used  when possible.  The "yes" setting is useful to work around
+              used when possible.  The "yes" setting is useful to work  around
               certain buggy PostScript interpreters.  This defaults to "no".
 
        psMinLineWidth float
-              Set the minimum line width, in points,  for  PostScript  output.
+              Set  the  minimum  line width, in points, for PostScript output.
               The default value is 0 (no minimum).
 
        psRasterResolution float
-              Set  the  resolution (in dpi) for rasterized pages in PostScript
-              output.  (Pdftops will rasterize pages which use  transparency.)
+              Set the resolution (in dpi) for rasterized pages  in  PostScript
+              output.   (Pdftops will rasterize pages which use transparency.)
               This defaults to 300.
 
        psRasterMono yes | no
@@ -285,8 +207,8 @@
               (8-bit gray) instead of color.  This defaults to "no".
 
        psRasterSliceSize pixels
-              When rasterizing pages, pdftops splits the page into  horizontal
-              "slices",  to  limit memory usage.  This option sets the maximum
+              When  rasterizing pages, pdftops splits the page into horizontal
+              "slices", to limit memory usage.  This option sets  the  maximum
               slice size, in pixels.  This defaults to 20000000 (20 million).
 
        psAlwaysRasterize yes | no
@@ -293,25 +215,32 @@
               If set to "yes", all PostScript output will be rasterized.  This
               defaults to "no".
 
+       psNeverRasterize yes | no
+              If set to "yes", PostScript output  will  never  be  rasterized.
+              This  will  likely result in incorrect output for PDF files that
+              use transparency.  (If both psAlwaysRasterize and psNeverRaster-
+              ize are set to "yes", the psAlwaysRasterize setting wins.)  This
+              defaults to "no".
+
        psFile file-or-command
-              Sets  the  default  PostScript  file  or print command for xpdf.
-              Commands start with a '|' character; anything else  is  a  file.
-              If  the  file name or command contains spaces it must be quoted.
-              This defaults to unset, which tells xpdf to generate a  name  of
+              Sets the default PostScript file  or  print  command  for  xpdf.
+              Commands  start  with  a '|' character; anything else is a file.
+              If the file name or command contains spaces it must  be  quoted.
+              This  defaults  to unset, which tells xpdf to generate a name of
               the form <file>.ps for a PDF file <file>.pdf.
 
        fontDir dir
               See the description above, in the DISPLAY FONTS section.
 
-TEXT CONTROL
+TEXT CONTROL AND CHARACTER MAPPING
        textEncoding encoding-name
               Sets the encoding to use for text output.  (This can be overrid-
-              den with the "-enc" switch on the  command  line.)   The  encod-
-              ing-name  must  be  defined  with  the  unicodeMap  command (see
+              den  with  the  "-enc"  switch on the command line.)  The encod-
+              ing-name must  be  defined  with  the  unicodeMap  command  (see
               above).  This defaults to "Latin1".
 
        textEOL unix | dos | mac
-              Sets the end-of-line convention to use  for  text  output.   The
+              Sets  the  end-of-line  convention  to use for text output.  The
               options are:
 
                   unix = LF
@@ -318,39 +247,126 @@
                   dos  = CR+LF
                   mac  = CR
 
-              (This  can  be  overridden with the "-eol" switch on the command
-              line.)  The default value is based on  the  OS  where  xpdf  and
+              (This can be overridden with the "-eol" switch  on  the  command
+              line.)   The  default  value  is  based on the OS where xpdf and
               pdftotext were built.
 
        textPageBreaks yes | no
-              If  set  to "yes", text extraction will insert page breaks (form
+              If set to "yes", text extraction will insert page  breaks  (form
               feed characters) between pages.  This defaults to "yes".
 
        textKeepTinyChars yes | no
-              If set to "yes", text extraction will keep all  characters.   If
-              set  to  "no", text extraction will discard tiny (smaller than 3
-              point) characters after  the  first  50000  per  page,  avoiding
+              If  set  to "yes", text extraction will keep all characters.  If
+              set to "no", text extraction will discard tiny (smaller  than  3
+              point)  characters  after  the  first  50000  per page, avoiding
               extremely slow run times for PDF files that use special fonts to
               do shading or cross-hatching.  This defaults to "yes".
 
-MISCELLANEOUS SETTINGS
-       initialZoom percentage | page | width
-              Sets the initial zoom factor.  A number specifies  a  zoom  per-
-              centage,  where  100 means 72 dpi.  You may also specify 'page',
-              to fit the page to the window size, or 'width', to fit the  page
-              width to the window width.
+       nameToUnicode map-file
+              Specifies  a  file with the mapping from character names to Uni-
+              code.  This is used to handle PDF fonts that have  valid  encod-
+              ings  but no ToUnicode entry.  Each line of a nameToUnicode file
+              looks like this:
 
-       continuousView yes | no
-              If  set to "yes", xpdf will start in continuous view mode, i.e.,
-              with one vertical screoll bar  for  the  whole  document.   This
+                   hex-string name
+
+              The hex-string is the Unicode (UCS-2) character index, and  name
+              is  the  corresponding  character  name.  Multiple nameToUnicode
+              files can be used; if a character name is given more than  once,
+              the  code in the last specified file is used.  There is a built-
+              in default nameToUnicode table  with  all  of  Adobe's  standard
+              character names.
+
+       cidToUnicode registry-ordering map-file
+              Specifies the file with the mapping from character collection to
+              Unicode.  Each line of a cidToUnicode file represents one  char-
+              acter:
+
+                   hex-string
+
+              The  hex-string is the Unicode (UCS-2) index for that character.
+              The first line maps CID 0, the second line  CID  1,  etc.   File
+              size  is  determined  by size of the character collection.  Only
+              one file is allowed per character collection; the last specified
+              file is used.  There are no built-in cidToUnicode mappings.
+
+       unicodeToUnicode font-name-substring map-file
+              This  is used to work around PDF fonts which have incorrect Uni-
+              code information.  It specifies a file which maps from the given
+              (incorrect)  Unicode  indexes  to the correct ones.  The mapping
+              will be used for any font  whose  name  contains  font-name-sub-
+              string.   Each  line  of  a unicodeToUnicode file represents one
+              Unicode character:
+
+                  in-hex out-hex1 out-hex2 ...
+
+              The in-hex field is an input (incorrect) Unicode index, and  the
+              rest  of  the  fields  are  one or more output (correct) Unicode
+              indexes.  Each occurrence of in-hex will  be  converted  to  the
+              specified output sequence.
+
+       unicodeMap encoding-name map-file
+              Specifies  the  file with mapping from Unicode to encoding-name.
+              These encodings are used for text output (see below).  Each line
+              of  a  unicodeMap file represents a range of one or more Unicode
+              characters which maps linearly to a range in the  output  encod-
+              ing:
+
+                   in-start-hex in-end-hex out-start-hex
+
+              Entries for single characters can be abbreviated to:
+
+                   in-hex out-hex
+
+              The  in-start-hex  and  in-end-hex  fields (or the single in-hex
+              field) specify the Unicode range.  The out-start-hex  field  (or
+              the  out-hex  field)  specifies the start of the output encoding
+              range.  The length of  the  out-start-hex  (or  out-hex)  string
+              determines the length of the output characters (e.g., UTF-8 uses
+              different numbers of bytes to represent characters in  different
+              ranges).   Entries  must  be  given in increasing Unicode order.
+              Only one file is allowed per encoding; the last  specified  file
+              is  used.   The Latin1, ASCII7, Symbol, ZapfDingbats, UTF-8, and
+              UCS-2 encodings are predefined.
+
+       cMapDir registry-ordering dir
+              Specifies a search  directory,  dir,  for  CMaps  for  the  reg-
+              istry-ordering  character  collection.   There  can  be multiple
+              directories for a particular collection.  There are  no  default
+              CMap directories.
+
+       toUnicodeDir dir
+              Specifies  a  search directory, dir, for ToUnicode CMaps.  There
+              can be multiple ToUnicode directories.   There  are  no  default
+              ToUnicode directories.
+
+       mapNumericCharNames yes | no
+              If  set  to  "yes",  the  Xpdf tools will attempt to map various
+              numeric character names sometimes used in font subsets.  In some
+              cases  this leads to usable text, and in other cases it leads to
+              gibberish -- there is no way for Xpdf to tell.  This defaults to
+              "yes".
+
+       mapUnknownCharNames yes | no
+              If  set  to  "yes",  and mapNumericCharNames is set to "no", the
+              Xpdf tools will apply a  simple  pass-through  mapping  (Unicode
+              index  = character code) for all unrecognized glyph names.  (For
+              CID fonts, setting mapNumericCharNames to "no" is  unnecessary.)
+              In  some cases, this leads to usable text, and in other cases it
+              leads to gibberish -- there is no way for Xpdf  to  tell.   This
               defaults to "no".
 
-       enableFreeType yes | no
-              Enables  or  disables  use of FreeType (a TrueType / Type 1 font
-              rasterizer).  This is only relevant if the Xpdf tools were built
-              with  FreeType  support.   ("enableFreeType"  replaces  the  old
-              "freetypeControl" option.)  This option defaults to "yes".
+       mapExtTrueTypeFontsViaUnicode yes | no
+              When rasterizing text using an external TrueType font, there are
+              two options for handling character  codes.   If  mapExtTrueType-
+              FontsViaUnicode  is  set to "yes", Xpdf will use the font encod-
+              ing/ToUnicode info to map character codes to Unicode,  and  then
+              use  the font's Unicode cmap to map Unicode to GIDs.  If mapExt-
+              TrueTypeFontsViaUnicode is set to "no",  Xpdf  will  assume  the
+              character  codes are GIDs (i.e., use an identity mapping).  This
+              defaults to "yes".
 
+RASTERIZER SETTINGS
        enableFreeType yes | no
               Enables or disables use of FreeType (a TrueType /  Type  1  font
               rasterizer).  This is only relevant if the Xpdf tools were built
@@ -377,57 +393,63 @@
               settings).  If  this  is  "no",  printed  bitmaps  will  not  be
               antialiased.  This defaults to "no".
 
-       strokeAdjust yes | no
-              Enables  or disables stroke adjustment.  Stroke adjustment moves
-              horizontal and vertical lines by up to half a pixel to make them
-              look  "cleaner"  when  vector  anti-aliasing  is  enabled.  This
-              defaults to "yes".
+       strokeAdjust yes | no | cad
+              Sets  the  stroke  adjustment  mode.   If set to "no", no stroke
+              adjustment will be done.  If set to "yes", normal stroke adjust-
+              ment  will  be done: horizontal and vertical lines will be moved
+              by up to half a pixel to make  them  look  cleaner  when  vector
+              anti-aliasing is enabled.  If set to "cad", a slightly different
+              stroke adjustment algorithm will be used to ensure that lines of
+              the same original width will always have the same adjusted width
+              (at the expense of allowing gaps and overlaps  between  adjacent
+              lines).  This defaults to "yes".
 
        screenType dispersed | clustered | stochasticClustered
-              Sets the halftone screen type, which will be used when  generat-
-              ing  a  monochrome  (1-bit)  bitmap.  The three options are dis-
-              persed-dot dithering, clustered-dot dithering (with a round  dot
-              and   45-degree  screen  angle),  and  stochastic  clustered-dot
-              dithering.  By default, "stochasticClustered" is used for  reso-
+              Sets  the halftone screen type, which will be used when generat-
+              ing a monochrome (1-bit) bitmap.  The  three  options  are  dis-
+              persed-dot  dithering, clustered-dot dithering (with a round dot
+              and  45-degree  screen  angle),  and  stochastic   clustered-dot
+              dithering.   By default, "stochasticClustered" is used for reso-
               lutions of 300 dpi and higher, and "dispersed" is used for reso-
               lutions lower then 300 dpi.
 
        screenSize integer
-              Sets the size of the (square) halftone screen threshold  matrix.
-              By  default, this is 4 for dispersed-dot dithering, 10 for clus-
-              tered-dot  dithering,  and  100  for  stochastic   clustered-dot
+              Sets  the size of the (square) halftone screen threshold matrix.
+              By default, this is 4 for dispersed-dot dithering, 10 for  clus-
+              tered-dot   dithering,  and  100  for  stochastic  clustered-dot
               dithering.
 
        screenDotRadius integer
-              Sets  the  halftone  screen  dot radius.  This is only used when
-              screenType is set to stochasticClustered, and it defaults to  2.
-              In  clustered-dot  mode,  the  dot  radius is half of the screen
+              Sets the halftone screen dot radius.  This  is  only  used  when
+              screenType  is set to stochasticClustered, and it defaults to 2.
+              In clustered-dot mode, the dot radius  is  half  of  the  screen
               size.  Dispersed-dot dithering doesn't have a dot radius.
 
        screenGamma float
               Sets the halftone screen gamma correction parameter.  Gamma val-
-              ues  greater  than 1 make the output brighter; gamma values less
+              ues greater than 1 make the output brighter; gamma  values  less
               than 1 make it darker.  The default value is 1.
 
        screenBlackThreshold float
-              When halftoning, all values below this threshold are  forced  to
+              When  halftoning,  all values below this threshold are forced to
               solid black.  This parameter is a floating point value between 0
               (black) and 1 (white).  The default value is 0.
 
        screenWhiteThreshold float
-              When halftoning, all values above this threshold are  forced  to
+              When  halftoning,  all values above this threshold are forced to
               solid white.  This parameter is a floating point value between 0
               (black) and 1 (white).  The default value is 1.
 
        minLineWidth float
-              Set the minimum line width, in device pixels.  This affects  the
-              rasterizer  only,  not  the PostScript converter (except when it
-              uses rasterization to handle transparency).  The  default  value
+              Set  the minimum line width, in device pixels.  This affects the
+              rasterizer only, not the PostScript converter  (except  when  it
+              uses  rasterization  to handle transparency).  The default value
               is 0 (no minimum).
 
-       drawAnnotations yes | no
-              If  set  to "no", annotations will not be drawn or printed.  The
-              default value is "yes".
+       enablePathSimplification yes | no
+              If set to "yes", simplify paths  by  removing  points  where  it
+              won't  make  a significant difference to the shape.  The default
+              value is "no".
 
        overprintPreview yes | no
               If set to "yes", generate overprint preview output, honoring the
@@ -434,56 +456,79 @@
               OP/op/OPM  settings  in the PDF file.  Ignored for non-CMYK out-
               put.  The default value is "no".
 
+VIEWER SETTINGS
+       These settings only apply to the Xpdf GUI PDF viewer.
+
+       initialZoom percentage | page | width
+              Sets the initial zoom factor.  A number specifies  a  zoom  per-
+              centage,  where  100 means 72 dpi.  You may also specify 'page',
+              to fit the page to the window size, or 'width', to fit the  page
+              width to the window width.
+
+       defaultFitZoom percentage
+              If xpdf is started with fit-page or fit-width zoom and no window
+              geometry, it will calculate a desired window size based  on  the
+              PDF  page  size and this defaultFitZoom value.  I.e., the window
+              size will be chosen such that exactly one page will fit  in  the
+              window  at  this  zoom factor (which must be a percentage).  The
+              default value is based on the screen resolution.
+
+       initialSidebarState yes | no
+              If set to "yes", xpdf opens with  the  sidebar  (tabs,  outline,
+              etc.)   visible.   If  set  to "no", xpdf opens with the sidebar
+              collapsed.  The default is "no".
+
+       paperColor color
+              Set the "paper color", i.e., the background of the page display.
+              The  color  can be #RRGGBB (hexadecimal) or a named color.  This
+              option will not work well with PDF files  that  do  things  like
+              filling in white behind the text.
+
+       matteColor color
+              Set the matte color, i.e., the color used for background outside
+              the actual page area.  The color can be #RRGGBB (hexadecimal) or
+              a named color.
+
+       fullScreenMatteColor color
+              Set  the  matte  color  for  full-screen mode.  The color can be
+              #RRGGBB (hexadecimal) or a named color.
+
+       popupMenuCmd title command ...
+              Add a command to the popup menu.  Title is the text to  be  dis-
+              played  in  the  menu.  Command is an Xpdf command (see the COM-
+              MANDS section of the xpdf(1) man page  for  details).   Multiple
+              commands are separated by whitespace.
+
+       maxTileWidth pixels
+              Set the maximum width of tiles to be used by xpdf when rasteriz-
+              ing pages.  This defaults to 1500.
+
+       maxTileHeight pixels
+              Set the maximum height of tiles to be used by xpdf when  raster-
+              izing pages.  This defaults to 1500.
+
+       tileCacheSize tiles
+              Set  the  maximum number of tiles to be cached by xpdf when ras-
+              terizing pages.  This defaults to 10.
+
+       workerThreads numThreads
+              Set the number of worker threads to be used by xpdf when raster-
+              izing pages.  This defaults to 1.
+
        launchCommand command
-              Sets the command executed when  you  click  on  a  "launch"-type
-              link.   The  intent  is  for  the command to be a program/script
-              which determines the file type and runs the appropriate  viewer.
-              The  command  line will consist of the file to be launched, fol-
-              lowed by any parameters specified with the  link.   Do  not  use
-              "%s"  in  "command".   By  default, this is unset, and Xpdf will
+              Sets  the  command  executed  when  you click on a "launch"-type
+              link.  The intent is for the  command  to  be  a  program/script
+              which  determines the file type and runs the appropriate viewer.
+              The command line will consist of the file to be  launched,  fol-
+              lowed  by  any  parameters  specified with the link.  Do not use
+              "%s" in "command".  By default, this is  unset,  and  Xpdf  will
               simply try to execute the file (after prompting the user).
 
-       urlCommand command
-              Sets the command executed when you click on  a  URL  link.   The
-              string  "%s"  will  be  replaced with the URL.  (See the example
-              below.)  This has no default value.
-
        movieCommand command
-              Sets the command executed when you click on a movie  annotation.
+              Sets  the command executed when you click on a movie annotation.
               The string "%s" will be replaced with the movie file name.  This
               has no default value.
 
-       mapNumericCharNames yes | no
-              If set to "yes", the Xpdf tools  will  attempt  to  map  various
-              numeric character names sometimes used in font subsets.  In some
-              cases this leads to usable text, and in other cases it leads  to
-              gibberish -- there is no way for Xpdf to tell.  This defaults to
-              "yes".
-
-       mapUnknownCharNames yes | no
-              If set to "yes", and mapNumericCharNames is  set  to  "no",  the
-              Xpdf  tools  will  apply  a simple pass-through mapping (Unicode
-              index = character code) for all unrecognized glyph names.   (For
-              CID  fonts, setting mapNumericCharNames to "no" is unnecessary.)
-              In some cases, this leads to usable text, and in other cases  it
-              leads  to  gibberish  -- there is no way for Xpdf to tell.  This
-              defaults to "no".
-
-       mapExtTrueTypeFontsViaUnicode yes | no
-              When rasterizing text using an external TrueType font, there are
-              two  options  for  handling character codes.  If mapExtTrueType-
-              FontsViaUnicode is set to "yes", Xpdf will use the  font  encod-
-              ing/ToUnicode  info  to map character codes to Unicode, and then
-              use the font's Unicode cmap to map Unicode to GIDs.  If  mapExt-
-              TrueTypeFontsViaUnicode  is  set  to  "no", Xpdf will assume the
-              character codes are GIDs (i.e., use an identity mapping).   This
-              defaults to "yes".
-
-       enableXFA yes | no
-              If  set  to  "yes", an XFA form (if present) will be rendered in
-              place of an AcroForm.  If "no", an XFA form will never  be  ren-
-              dered.  This defaults to "yes".
-
        bind modifiers-key context command ...
               Add  a  key  or  mouse button binding.  Modifiers can be zero or
               more of:
@@ -499,6 +544,7 @@
                   return
                   enter
                   backspace
+                  esc
                   insert
                   delete
                   home
@@ -509,6 +555,7 @@
                   f1 .. f35                       (function keys)
                   mousePress1 .. mousePress7      (mouse buttons)
                   mouseRelease1 .. mouseRelease7  (mouse buttons)
+                  mouseClick1 .. mouseClick7      (mouse buttons)
 
               Context is either "any" or a comma-separated combination of:
 
@@ -548,6 +595,20 @@
               "any" context, and you want to create new key bindings for  mul-
               tiple contexts).
 
+MISCELLANEOUS SETTINGS
+       drawAnnotations yes | no
+              If  set  to "no", annotations will not be drawn or printed.  The
+              default value is "yes".
+
+       drawFormFields yes | no
+              If set to "no", form fields will not be drawn or  printed.   The
+              default value is "yes".
+
+       enableXFA yes | no
+              If  set  to  "yes", an XFA form (if present) will be rendered in
+              place of an AcroForm.  If "no", an XFA form will never  be  ren-
+              dered.  This defaults to "yes".
+
        printCommands yes | no
               If  set  to  "yes", drawing commands are printed as they're exe-
               cuted (useful for debugging).  This defaults to "no".
@@ -620,14 +681,14 @@
               read in place of the system-wide file.
 
 AUTHOR
-       The  Xpdf  software  and  documentation are copyright 1996-2014 Glyph &
+       The  Xpdf  software  and  documentation are copyright 1996-2017 Glyph &
        Cog, LLC.
 
 SEE ALSO
        xpdf(1),  pdftops(1),  pdftotext(1),  pdftohtml(1),  pdfinfo(1),   pdf-
        fonts(1), pdfdetach(1), pdftoppm(1), pdftopng(1), pdfimages(1)
-       http://www.foolabs.com/xpdf/
+       http://www.xpdfreader.com/
 
 
 
-                                  28 May 2014                        xpdfrc(5)
+                                  10 Aug 2017                        xpdfrc(5)

Added: branches/stable/source/src/libs/xpdf/xpdf-src/fofi/CMakeLists.txt
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/fofi/CMakeLists.txt	                        (rev 0)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/fofi/CMakeLists.txt	2017-11-01 18:15:56 UTC (rev 780)
@@ -0,0 +1,26 @@
+#========================================================================
+#
+# fofi/CMakeLists.txt
+#
+# CMake script for the fofi library.
+#
+# Copyright 2015 Glyph & Cog, LLC
+#
+#========================================================================
+
+include_directories("${PROJECT_SOURCE_DIR}")
+include_directories("${PROJECT_BINARY_DIR}")
+include_directories("${PROJECT_SOURCE_DIR}/goo")
+
+add_library(fofi_objs OBJECT
+  FoFiBase.cc
+  FoFiEncodings.cc
+  FoFiIdentifier.cc
+  FoFiTrueType.cc
+  FoFiType1.cc
+  FoFiType1C.cc
+)
+
+add_library(fofi
+  $<TARGET_OBJECTS:fofi_objs>
+)


Property changes on: branches/stable/source/src/libs/xpdf/xpdf-src/fofi/CMakeLists.txt
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: branches/stable/source/src/libs/xpdf/xpdf-src/fofi/FoFiBase.cc
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/fofi/FoFiBase.cc	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/fofi/FoFiBase.cc	2017-11-01 18:15:56 UTC (rev 780)
@@ -15,6 +15,7 @@
 #include <stdio.h>
 #include <limits.h>
 #include "gmem.h"
+#include "gmempp.h"
 #include "FoFiBase.h"
 
 //------------------------------------------------------------------------

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/fofi/FoFiEncodings.cc
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/fofi/FoFiEncodings.cc	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/fofi/FoFiEncodings.cc	2017-11-01 18:15:56 UTC (rev 780)
@@ -13,6 +13,7 @@
 #endif
 
 #include <stdlib.h>
+#include "gmempp.h"
 #include "FoFiEncodings.h"
 
 //------------------------------------------------------------------------

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/fofi/FoFiIdentifier.cc
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/fofi/FoFiIdentifier.cc	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/fofi/FoFiIdentifier.cc	2017-11-01 18:15:56 UTC (rev 780)
@@ -17,6 +17,7 @@
 #include <limits.h>
 #include "gtypes.h"
 #include "gmem.h"
+#include "gmempp.h"
 #include "GString.h"
 #include "GList.h"
 #include "FoFiIdentifier.h"

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/fofi/FoFiTrueType.cc
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/fofi/FoFiTrueType.cc	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/fofi/FoFiTrueType.cc	2017-11-01 18:15:56 UTC (rev 780)
@@ -19,6 +19,7 @@
 #endif
 #include "gtypes.h"
 #include "gmem.h"
+#include "gmempp.h"
 #include "GString.h"
 #include "GHash.h"
 #include "FoFiType1C.h"
@@ -119,7 +120,7 @@
 #define os2Tag  0x4f532f32
 #define postTag 0x706f7374
 
-#ifdef HAVE_STD_SORT
+#if HAVE_STD_SORT
 
 struct cmpTrueTypeLocaOffsetFunctor {
   bool operator()(const TrueTypeLoca &loca1, const TrueTypeLoca &loca2) {
@@ -525,6 +526,119 @@
   delete ff;
 }
 
+struct FoFiTrueTypeTrickyFont {
+  int cvtLen;
+  Guint cvtChecksum;
+  int fpgmLen;
+  Guint fpgmChecksum;
+  int prepLen;
+  Guint prepChecksum;
+};
+
+// This data was taken from the FreeType project.
+static FoFiTrueTypeTrickyFont trickyFonts[] = {
+  { 0x000002e4, 0x05bcf058,	// MingLiU 1995
+    0x000087c4, 0x28233bf1,
+    0x000001e1, 0xa344a1ea },
+  { 0x000002e4, 0x05bcf058,	// MingLiU 1996-
+    0x000087c4, 0x28233bf1,
+    0x000001e1, 0xa344a1eb },
+  { 0x00000350, 0x11e5ead4,	// DFKaiShu
+    0x00009063, 0x5a30ca3b,
+    0x0000007e, 0x13a42602 },
+  { 0x00000350, 0x11e5ead4,	// DFKaiShu2
+    0x00008998, 0xa6e78c01,
+    0x0000007e, 0x13a42602 },
+  { 0x00000008, 0xfffbfffc,	// HuaTianKaiTi
+    0x0000bea2, 0x9c9e48b8,
+    0x00000008, 0x70020112 },
+  { 0x00000008, 0xfffbfffc,	// HuaTianSongTi
+    0x00017c39, 0x0a5a0483,
+    0x00000008, 0x70020112 },
+  { 0x00000000, 0x00000000,	// NEC fadpop7.ttf
+    0x000000e5, 0x40c92555,
+    0x0000117c, 0xa39b58e3 },
+  { 0x00000000, 0x00000000,	// NEC fadrei5.ttf
+    0x000000e5, 0x33c41652,
+    0x00000f6a, 0x26d6c52a },
+  { 0x00000000, 0x00000000,	// NEC fangot7.ttf
+    0x0000019d, 0x6db1651d,
+    0x00002492, 0x6c6e4b03 },
+  { 0x00000000, 0x00000000,	// NEC fangyo5.ttf
+    0x000000e5, 0x40c92555,
+    0x0000117c, 0xde51fad0 },
+  { 0x00000000, 0x00000000,	// NEC fankyo5.ttf
+    0x000000e5, 0x85e47664,
+    0x00001caa, 0xa6c62831 },
+  { 0x00000000, 0x00000000,	// NEC fanrgo5.ttf
+    0x0000019d, 0x2d891cfd,
+    0x00001de8, 0xa0604633 },
+  { 0x00000000, 0x00000000,	// NEC fangot5.ttc
+    0x000001cb, 0x40aa774c,
+    0x00001f9a, 0x9b5caa96 },
+  { 0x00000000, 0x00000000,	// NEC fanmin3.ttc
+    0x00000141, 0x0d3de9cb,
+    0x00002280, 0xd4127766 },
+  { 0x00000000, 0x00000000,	// NEC FA-Gothic, 1996
+    0x000001f0, 0x4a692698,
+    0x00001fca, 0x340d4346 },
+  { 0x00000000, 0x00000000,	// NEC FA-Minchou, 1996
+    0x00000166, 0xcd34c604,
+    0x000022b0, 0x6cf31046 },
+  { 0x00000000, 0x00000000,	// NEC FA-RoundGothicB, 1996
+    0x0000019d, 0x5da75315,
+    0x000022e0, 0x40745a5f },
+  { 0x00000000, 0x00000000,	// NEC FA-RoundGothicM, 1996
+    0x000001c2, 0xf055fc48,
+    0x00001e18, 0x3900ded3 }
+};
+
+#define nTrickyFonts ((int)(sizeof(trickyFonts) / sizeof(FoFiTrueTypeTrickyFont)))
+
+// This looks at the length and checksum values for the cvt, fpgm, and
+// prep tables.  The theory is that those tables will be the same,
+// even if the font is renamed and/or subsetted.
+GBool FoFiTrueType::checkForTrickyCJK() {
+  int cvtIdx, fpgmIdx, prepIdx;
+  int cvtLen, fpgmLen, prepLen;
+  Guint cvtChecksum, fpgmChecksum, prepChecksum;
+  int i;
+
+  if ((cvtIdx = seekTable("cvt ")) >= 0) {
+    cvtLen = tables[cvtIdx].len;
+    cvtChecksum = tables[cvtIdx].checksum;
+  } else {
+    cvtLen = 0;
+    cvtChecksum = 0;
+  }
+  if ((fpgmIdx = seekTable("fpgm")) >= 0) {
+    fpgmLen = tables[fpgmIdx].len;
+    fpgmChecksum = tables[fpgmIdx].checksum;
+  } else {
+    fpgmLen = 0;
+    fpgmChecksum = 0;
+  }
+  if ((prepIdx = seekTable("prep")) >= 0) {
+    prepLen = tables[prepIdx].len;
+    prepChecksum = tables[prepIdx].checksum;
+  } else {
+    prepLen = 0;
+    prepChecksum = 0;
+  }
+
+  for (i = 0; i < nTrickyFonts; ++i) {
+    if (cvtLen == trickyFonts[i].cvtLen &&
+	cvtChecksum == trickyFonts[i].cvtChecksum &&
+	fpgmLen == trickyFonts[i].fpgmLen &&
+	fpgmChecksum == trickyFonts[i].fpgmChecksum &&
+	prepLen == trickyFonts[i].prepLen &&
+	prepChecksum == trickyFonts[i].prepChecksum) {
+      return gTrue;
+    }
+  }
+  return gFalse;
+}
+
 void FoFiTrueType::convertToType42(char *psName, char **encoding,
 				   int *codeToGID,
 				   FoFiOutputFunc outputFunc,
@@ -966,6 +1080,7 @@
   unsortedLoca = gFalse;
   i = seekTable("loca");
   pos = tables[i].offset;
+  glyfLen = tables[seekTable("glyf")].len;
   ok = gTrue;
   for (i = 0; i <= nGlyphs; ++i) {
     if (locaFmt) {
@@ -973,6 +1088,11 @@
     } else {
       locaTable[i].origOffset = 2 * getU16BE(pos + i*2, &ok);
     }
+    if (locaTable[i].origOffset < 0 ||
+	locaTable[i].origOffset > glyfLen) {
+      locaTable[i].origOffset = glyfLen;
+      unsortedLoca = gTrue;
+    }
     if (i > 0 && locaTable[i].origOffset < locaTable[i-1].origOffset) {
       unsortedLoca = gTrue;
     }
@@ -1562,11 +1682,6 @@
   (*outputFunc)(outputStream, "/CharStrings 256 dict dup begin\n", 32);
   (*outputFunc)(outputStream, "/.notdef 0 def\n", 15);
 
-  // if there's no 'cmap' table, punt
-  if (nCmaps == 0) {
-    goto err;
-  }
-
   // map char name to glyph index:
   // 1. use encoding to map name to char code
   // 2. use codeToGID to map char code to glyph index
@@ -1597,7 +1712,6 @@
     }
   }
 
- err:
   (*outputFunc)(outputStream, "end readonly def\n", 17);
 }
 
@@ -2115,8 +2229,8 @@
     return;
   }
 
-  // make sure the loca table is sane (correct length and entries are
-  // in bounds)
+  // make sure the loca table is sane (correct length)
+  // NB: out-of-bounds entries are handled in writeTTF()
   if (!openTypeCFF) {
     i = seekTable("loca");
     if (tables[i].len < 0) {
@@ -2126,16 +2240,6 @@
     if (tables[i].len < (nGlyphs + 1) * (locaFmt ? 4 : 2)) {
       nGlyphs = tables[i].len / (locaFmt ? 4 : 2) - 1;
     }
-    for (j = 0; j <= nGlyphs; ++j) {
-      if (locaFmt) {
-	pos = (int)getU32BE(tables[i].offset + j*4, &parsedOk);
-      } else {
-	pos = getU16BE(tables[i].offset + j*2, &parsedOk);
-      }
-      if (pos < 0 || pos > len) {
-	parsedOk = gFalse;
-      }
-    }
     if (!parsedOk) {
       return;
     }
@@ -2245,6 +2349,7 @@
     stringIdx = 0;
     stringPos = tablePos + 34 + 2*n;
     for (i = 0; i < n; ++i) {
+      ok = gTrue;
       j = getU16BE(tablePos + 34 + 2*i, &ok);
       if (j < 258) {
 	nameToGID->removeInt(macGlyphNames[j]);
@@ -2256,12 +2361,12 @@
 	       stringIdx < j;
 	       ++stringIdx, stringPos += 1 + getU8(stringPos, &ok)) ;
 	  if (!ok) {
-	    goto err;
+	    continue;
 	  }
 	}
 	m = getU8(stringPos, &ok);
 	if (!ok || !checkRegion(stringPos + 1, m)) {
-	  goto err;
+	  continue;
 	}
 	name = new GString((char *)&file[stringPos + 1], m);
 	nameToGID->removeInt(name);
@@ -2275,7 +2380,7 @@
     for (i = 0; i < nGlyphs; ++i) {
       j = getU8(tablePos + 32 + i, &ok);
       if (!ok) {
-	goto err;
+	continue;
       }
       if (j < 258) {
 	nameToGID->removeInt(macGlyphNames[j]);

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/fofi/FoFiTrueType.h
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/fofi/FoFiTrueType.h	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/fofi/FoFiTrueType.h	2017-11-01 18:15:56 UTC (rev 780)
@@ -95,6 +95,10 @@
   // for OpenType CFF fonts.)
   void getFontMatrix(double *mat);
 
+  // Returns true if this looks like a CJK font that uses bytecode
+  // instructions to assemble glyphs.
+  GBool checkForTrickyCJK();
+
   // Convert to a Type 42 font, suitable for embedding in a PostScript
   // file.  <psName> will be used as the PostScript font name (so we
   // don't need to depend on the 'name' table in the font).  The

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/fofi/FoFiType1.cc
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/fofi/FoFiType1.cc	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/fofi/FoFiType1.cc	2017-11-01 18:15:56 UTC (rev 780)
@@ -15,6 +15,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include "gmem.h"
+#include "gmempp.h"
 #include "FoFiEncodings.h"
 #include "FoFiType1.h"
 
@@ -198,7 +199,7 @@
 
   gotMatrix = gFalse;
   for (i = 1, line = (char *)file;
-       i <= 100 && line && (!name || !encoding);
+       i <= 100 && line && (!name || !encoding || !gotMatrix);
        ++i) {
 
     // get font name
@@ -255,6 +256,7 @@
 	    if (code >= 0 && code < 256) {
 	      c = *p2;
 	      *p2 = '\0';
+	      gfree(encoding[code]);
 	      encoding[code] = copyString(p);
 	      *p2 = c;
 	    }

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/fofi/FoFiType1C.cc
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/fofi/FoFiType1C.cc	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/fofi/FoFiType1C.cc	2017-11-01 18:15:56 UTC (rev 780)
@@ -16,6 +16,7 @@
 #include <string.h>
 #include <math.h>
 #include "gmem.h"
+#include "gmempp.h"
 #include "GString.h"
 #include "FoFiEncodings.h"
 #include "FoFiType1C.h"
@@ -25,6 +26,44 @@
 static char hexChars[17] = "0123456789ABCDEF";
 
 //------------------------------------------------------------------------
+
+GBool Type1COp::isZero() {
+  switch (kind) {
+  case type1COpInteger:  return intgr == 0;
+  case type1COpFloat:    return flt == 0;
+  case type1COpRational: return rat.num == 0;
+  default:               return gFalse;   // shouldn't happen
+  }
+}
+
+GBool Type1COp::isNegative() {
+  switch (kind) {
+  case type1COpInteger:  return intgr < 0;
+  case type1COpFloat:    return flt < 0;
+  case type1COpRational: return (rat.num < 0) != (rat.den < 0);
+  default:               return gFalse;   // shouldn't happen
+  }
+}
+
+int Type1COp::toInt() {
+  switch (kind) {
+  case type1COpInteger:  return intgr;
+  case type1COpFloat:    return (int)flt;
+  case type1COpRational: return rat.num / rat.den;
+  default:               return 0;   // shouldn't happen
+  }
+}
+
+double Type1COp::toFloat() {
+  switch (kind) {
+  case type1COpInteger:  return (double)intgr;
+  case type1COpFloat:    return flt;
+  case type1COpRational: return (double)rat.num / (double)rat.den;
+  default:               return 0.0;   // shouldn't happen
+  }
+}
+
+//------------------------------------------------------------------------
 // FoFiType1C
 //------------------------------------------------------------------------
 
@@ -744,7 +783,7 @@
 	  break;
 	}
       }
-      if (j == privateDicts[0].nStemSnapH) {
+      if (j == privateDicts[i].nStemSnapH) {
 	(*outputFunc)(outputStream, "/StemSnapH [", 12);
 	for (j = 0; j < privateDicts[i].nStemSnapH; ++j) {
 	  buf = GString::format("{0:s}{1:.4g}",
@@ -763,7 +802,7 @@
 	  break;
 	}
       }
-      if (j == privateDicts[0].nStemSnapV) {
+      if (j == privateDicts[i].nStemSnapV) {
 	(*outputFunc)(outputStream, "/StemSnapV [", 12);
 	for (j = 0; j < privateDicts[i].nStemSnapV; ++j) {
 	  buf = GString::format("{0:s}{1:.4g}",
@@ -1060,7 +1099,7 @@
 	  break;
 	}
       }
-      if (k == privateDicts[0].nStemSnapH) {
+      if (k == privateDicts[fd].nStemSnapH) {
 	eexecWrite(&eb, "/StemSnapH [");
 	for (k = 0; k < privateDicts[fd].nStemSnapH; ++k) {
 	  buf = GString::format("{0:s}{1:.4g}",
@@ -1080,7 +1119,7 @@
 	  break;
 	}
       }
-      if (k == privateDicts[0].nStemSnapV) {
+      if (k == privateDicts[fd].nStemSnapV) {
 	eexecWrite(&eb, "/StemSnapV [");
 	for (k = 0; k < privateDicts[fd].nStemSnapV; ++k) {
 	  buf = GString::format("{0:s}{1:.4g}",
@@ -1228,11 +1267,12 @@
 			  Type1CIndex *subrIdx, Type1CPrivateDict *pDict,
 			  GBool top) {
   Type1CIndexVal val;
-  GBool ok, dFP;
+  Type1COp zero, tmp;
+  GBool ok, dInt;
   double d, dx, dy;
   Gushort r2;
   Guchar byte;
-  int pos, subrBias, start, i, k;
+  int pos, subrBias, start, num, den, i, k;
 
   start = charBuf->getLength();
   if (top) {
@@ -1246,6 +1286,9 @@
     openPath = gFalse;
   }
 
+  zero.kind = type1COpInteger;
+  zero.intgr = 0;
+
   pos = offset;
   while (pos < offset + nBytes) {
     ok = gTrue;
@@ -1253,7 +1296,7 @@
     if (!ok) {
       break;
     }
-    if (!ops[nOps - 1].isNum) {
+    if (ops[nOps - 1].kind == type1COpOperator) {
       --nOps; // drop the operator
       switch (ops[nOps].op) {
       case 0x0001:		// hstem
@@ -1265,21 +1308,47 @@
 	  //~ error(-1, "Wrong number of args (%d) to Type 2 hstem", nOps);
 	}
 	d = 0;
-	dFP = gFalse;
-	for (k = 0; k < nOps; k += 2) {
+	dInt = gTrue;
+	for (k = 0; k+1 < nOps; k += 2) {
 	  // convert Type 2 edge hints (-20 or -21) to Type 1 ghost hints
-	  if (ops[k+1].num < 0) {
-	    d += ops[k].num + ops[k+1].num;
-	    dFP |= ops[k].isFP | ops[k+1].isFP;
-	    cvtNum(d, dFP, charBuf);
-	    cvtNum(-ops[k+1].num, ops[k+1].isFP, charBuf);
+	  if (ops[k+1].isNegative()) {
+	    d += ops[k].toFloat() + ops[k+1].toFloat();
+	    dInt &= ops[k].kind == type1COpInteger;
+	    dInt &= ops[k+1].kind == type1COpInteger;
+	    if (dInt) {
+	      tmp.kind = type1COpInteger;
+	      tmp.intgr = (int)(d + 0.5);
+	    } else {
+	      tmp.kind = type1COpFloat;
+	      tmp.flt = d;
+	    }
+	    cvtNum(tmp, charBuf);
+	    if (ops[k+1].kind == type1COpInteger) {
+	      tmp.kind = type1COpInteger;
+	      tmp.intgr = -ops[k+1].intgr;
+	    } else if (ops[k+1].kind == type1COpRational) {
+	      tmp.kind = type1COpRational;
+	      tmp.rat.num = -ops[k+1].rat.num;
+	      tmp.rat.den = ops[k+1].rat.den;
+	    } else {
+	      tmp.kind = type1COpFloat;
+	      tmp.flt = -ops[k+1].toFloat();
+	    }
+	    cvtNum(tmp, charBuf);
 	  } else {
-	    d += ops[k].num;
-	    dFP |= ops[k].isFP;
-	    cvtNum(d, dFP, charBuf);
-	    cvtNum(ops[k+1].num, ops[k+1].isFP, charBuf);
-	    d += ops[k+1].num;
-	    dFP |= ops[k+1].isFP;
+	    d += ops[k].toFloat();
+	    dInt &= ops[k].kind == type1COpInteger;
+	    if (dInt) {
+	      tmp.kind = type1COpInteger;
+	      tmp.intgr = (int)(d + 0.5);
+	    } else {
+	      tmp.kind = type1COpFloat;
+	      tmp.flt = d;
+	    }
+	    cvtNum(tmp, charBuf);
+	    cvtNum(ops[k+1], charBuf);
+	    d += ops[k+1].toFloat();
+	    dInt &= ops[k+1].kind == type1COpInteger;
 	  }
 	  charBuf->append((char)1);
 	}
@@ -1295,21 +1364,47 @@
 	  //~ error(-1, "Wrong number of args (%d) to Type 2 vstem", nOps);
 	}
 	d = 0;
-	dFP = gFalse;
-	for (k = 0; k < nOps; k += 2) {
+	dInt = gTrue;
+	for (k = 0; k+1 < nOps; k += 2) {
 	  // convert Type 2 edge hints (-20 or -21) to Type 1 ghost hints
-	  if (ops[k+1].num < 0) {
-	    d += ops[k].num + ops[k+1].num;
-	    dFP |= ops[k].isFP | ops[k+1].isFP;
-	    cvtNum(d, dFP, charBuf);
-	    cvtNum(-ops[k+1].num, ops[k+1].isFP, charBuf);
+	  if (ops[k+1].isNegative()) {
+	    d += ops[k].toFloat() + ops[k+1].toFloat();
+	    dInt &= ops[k].kind == type1COpInteger;
+	    dInt &= ops[k+1].kind == type1COpInteger;
+	    if (dInt) {
+	      tmp.kind = type1COpInteger;
+	      tmp.intgr = (int)(d + 0.5);
+	    } else {
+	      tmp.kind = type1COpFloat;
+	      tmp.flt = d;
+	    }
+	    cvtNum(tmp, charBuf);
+	    if (ops[k+1].kind == type1COpInteger) {
+	      tmp.kind = type1COpInteger;
+	      tmp.intgr = -ops[k+1].intgr;
+	    } else if (ops[k+1].kind == type1COpRational) {
+	      tmp.kind = type1COpRational;
+	      tmp.rat.num = -ops[k+1].rat.num;
+	      tmp.rat.den = ops[k+1].rat.den;
+	    } else {
+	      tmp.kind = type1COpFloat;
+	      tmp.flt = -ops[k+1].toFloat();
+	    }
+	    cvtNum(tmp, charBuf);
 	  } else {
-	    d += ops[k].num;
-	    dFP |= ops[k].isFP;
-	    cvtNum(d, dFP, charBuf);
-	    cvtNum(ops[k+1].num, ops[k+1].isFP, charBuf);
-	    d += ops[k+1].num;
-	    dFP |= ops[k+1].isFP;
+	    d += ops[k].toFloat();
+	    dInt &= ops[k].kind == type1COpInteger;
+	    if (dInt) {
+	      tmp.kind = type1COpInteger;
+	      tmp.intgr = (int)(d + 0.5);
+	    } else {
+	      tmp.kind = type1COpFloat;
+	      tmp.flt = d;
+	    }
+	    cvtNum(tmp, charBuf);
+	    cvtNum(ops[k+1], charBuf);
+	    d += ops[k+1].toFloat();
+	    dInt &= ops[k+1].kind == type1COpInteger;
 	  }
 	  charBuf->append((char)3);
 	}
@@ -1328,7 +1423,7 @@
 	if (nOps != 1) {
 	  //~ error(-1, "Wrong number of args (%d) to Type 2 vmoveto", nOps);
 	}
-	cvtNum(ops[0].num, ops[0].isFP, charBuf);
+	cvtNum(ops[0], charBuf);
 	charBuf->append((char)4);
 	nOps = 0;
 	break;
@@ -1336,9 +1431,9 @@
 	if (nOps < 2 || nOps % 2 != 0) {
 	  //~ error(-1, "Wrong number of args (%d) to Type 2 rlineto", nOps);
 	}
-	for (k = 0; k < nOps; k += 2) {
-	  cvtNum(ops[k].num, ops[k].isFP, charBuf);
-	  cvtNum(ops[k+1].num, ops[k+1].isFP, charBuf);
+	for (k = 0; k+1 < nOps; k += 2) {
+	  cvtNum(ops[k], charBuf);
+	  cvtNum(ops[k+1], charBuf);
 	  charBuf->append((char)5);
 	}
 	nOps = 0;
@@ -1349,7 +1444,7 @@
 	  //~ error(-1, "Wrong number of args (%d) to Type 2 hlineto", nOps);
 	}
 	for (k = 0; k < nOps; ++k) {
-	  cvtNum(ops[k].num, ops[k].isFP, charBuf);
+	  cvtNum(ops[k], charBuf);
 	  charBuf->append((char)((k & 1) ? 7 : 6));
 	}
 	nOps = 0;
@@ -1360,7 +1455,7 @@
 	  //~ error(-1, "Wrong number of args (%d) to Type 2 vlineto", nOps);
 	}
 	for (k = 0; k < nOps; ++k) {
-	  cvtNum(ops[k].num, ops[k].isFP, charBuf);
+	  cvtNum(ops[k], charBuf);
 	  charBuf->append((char)((k & 1) ? 6 : 7));
 	}
 	nOps = 0;
@@ -1371,12 +1466,12 @@
 	  //~ error(-1, "Wrong number of args (%d) to Type 2 rrcurveto", nOps);
 	}
 	for (k = 0; k < nOps; k += 6) {
-	  cvtNum(ops[k].num, ops[k].isFP, charBuf);
-	  cvtNum(ops[k+1].num, ops[k+1].isFP, charBuf);
-	  cvtNum(ops[k+2].num, ops[k+2].isFP, charBuf);
-	  cvtNum(ops[k+3].num, ops[k+3].isFP, charBuf);
-	  cvtNum(ops[k+4].num, ops[k+4].isFP, charBuf);
-	  cvtNum(ops[k+5].num, ops[k+5].isFP, charBuf);
+	  cvtNum(ops[k], charBuf);
+	  cvtNum(ops[k+1], charBuf);
+	  cvtNum(ops[k+2], charBuf);
+	  cvtNum(ops[k+3], charBuf);
+	  cvtNum(ops[k+4], charBuf);
+	  cvtNum(ops[k+5], charBuf);
 	  charBuf->append((char)8);
 	}
 	nOps = 0;
@@ -1386,7 +1481,7 @@
 	if (nOps >= 1) {
 	  subrBias = (subrIdx->len < 1240)
 	               ? 107 : (subrIdx->len < 33900) ? 1131 : 32768;
-	  k = subrBias + (int)ops[nOps - 1].num;
+	  k = subrBias + ops[nOps - 1].toInt();
 	  --nOps;
 	  ok = gTrue;
 	  getIndexVal(subrIdx, k, &val, &ok);
@@ -1411,11 +1506,11 @@
 	  openPath = gFalse;
 	}
 	if (nOps == 4) {
-	  cvtNum(0, gFalse, charBuf);
-	  cvtNum(ops[0].num, ops[0].isFP, charBuf);
-	  cvtNum(ops[1].num, ops[1].isFP, charBuf);
-	  cvtNum(ops[2].num, ops[2].isFP, charBuf);
-	  cvtNum(ops[3].num, ops[3].isFP, charBuf);
+	  cvtNum(zero, charBuf);
+	  cvtNum(ops[0], charBuf);
+	  cvtNum(ops[1], charBuf);
+	  cvtNum(ops[2], charBuf);
+	  cvtNum(ops[3], charBuf);
 	  charBuf->append((char)12)->append((char)6);
 	} else if (nOps == 0) {
 	  charBuf->append((char)14);
@@ -1492,8 +1587,8 @@
 	if (nOps != 2) {
 	  //~ error(-1, "Wrong number of args (%d) to Type 2 rmoveto", nOps);
 	}
-	cvtNum(ops[0].num, ops[0].isFP, charBuf);
-	cvtNum(ops[1].num, ops[1].isFP, charBuf);
+	cvtNum(ops[0], charBuf);
+	cvtNum(ops[1], charBuf);
 	charBuf->append((char)21);
 	nOps = 0;
 	break;
@@ -1509,7 +1604,7 @@
 	if (nOps != 1) {
 	  //~ error(-1, "Wrong number of args (%d) to Type 2 hmoveto", nOps);
 	}
-	cvtNum(ops[0].num, ops[0].isFP, charBuf);
+	cvtNum(ops[0], charBuf);
 	charBuf->append((char)22);
 	nOps = 0;
 	break;
@@ -1529,17 +1624,17 @@
 	if (nOps < 8 || (nOps - 2) % 6 != 0) {
 	  //~ error(-1, "Wrong number of args (%d) to Type 2 rcurveline", nOps);
 	}
-	for (k = 0; k < nOps - 2; k += 6) {
-	  cvtNum(ops[k].num, ops[k].isFP, charBuf);
-	  cvtNum(ops[k+1].num, ops[k+1].isFP, charBuf);
-	  cvtNum(ops[k+2].num, ops[k+2].isFP, charBuf);
-	  cvtNum(ops[k+3].num, ops[k+3].isFP, charBuf);
-	  cvtNum(ops[k+4].num, ops[k+4].isFP, charBuf);
-	  cvtNum(ops[k+5].num, ops[k+5].isFP, charBuf);
+	for (k = 0; k <= nOps - 8; k += 6) {
+	  cvtNum(ops[k], charBuf);
+	  cvtNum(ops[k+1], charBuf);
+	  cvtNum(ops[k+2], charBuf);
+	  cvtNum(ops[k+3], charBuf);
+	  cvtNum(ops[k+4], charBuf);
+	  cvtNum(ops[k+5], charBuf);
 	  charBuf->append((char)8);
 	}
-	cvtNum(ops[k].num, ops[k].isFP, charBuf);
-	cvtNum(ops[k+1].num, ops[k].isFP, charBuf);
+	cvtNum(ops[k], charBuf);
+	cvtNum(ops[k+1], charBuf);
 	charBuf->append((char)5);
 	nOps = 0;
 	openPath = gTrue;
@@ -1548,17 +1643,17 @@
 	if (nOps < 8 || (nOps - 6) % 2 != 0) {
 	  //~ error(-1, "Wrong number of args (%d) to Type 2 rlinecurve", nOps);
 	}
-	for (k = 0; k < nOps - 6; k += 2) {
-	  cvtNum(ops[k].num, ops[k].isFP, charBuf);
-	  cvtNum(ops[k+1].num, ops[k].isFP, charBuf);
+	for (k = 0; k <= nOps - 8; k += 2) {
+	  cvtNum(ops[k], charBuf);
+	  cvtNum(ops[k+1], charBuf);
 	  charBuf->append((char)5);
 	}
-	cvtNum(ops[k].num, ops[k].isFP, charBuf);
-	cvtNum(ops[k+1].num, ops[k+1].isFP, charBuf);
-	cvtNum(ops[k+2].num, ops[k+2].isFP, charBuf);
-	cvtNum(ops[k+3].num, ops[k+3].isFP, charBuf);
-	cvtNum(ops[k+4].num, ops[k+4].isFP, charBuf);
-	cvtNum(ops[k+5].num, ops[k+5].isFP, charBuf);
+	cvtNum(ops[k], charBuf);
+	cvtNum(ops[k+1], charBuf);
+	cvtNum(ops[k+2], charBuf);
+	cvtNum(ops[k+3], charBuf);
+	cvtNum(ops[k+4], charBuf);
+	cvtNum(ops[k+5], charBuf);
 	charBuf->append((char)8);
 	nOps = 0;
 	openPath = gTrue;
@@ -1567,25 +1662,25 @@
 	if (nOps < 4 || !(nOps % 4 == 0 || (nOps-1) % 4 == 0)) {
 	  //~ error(-1, "Wrong number of args (%d) to Type 2 vvcurveto", nOps);
 	}
-	if (nOps % 2 == 1) {
-	  cvtNum(ops[0].num, ops[0].isFP, charBuf);
-	  cvtNum(ops[1].num, ops[1].isFP, charBuf);
-	  cvtNum(ops[2].num, ops[2].isFP, charBuf);
-	  cvtNum(ops[3].num, ops[3].isFP, charBuf);
-	  cvtNum(0, gFalse, charBuf);
-	  cvtNum(ops[4].num, ops[4].isFP, charBuf);
+	if (nOps % 2 == 1 && nOps >= 5) {
+	  cvtNum(ops[0], charBuf);
+	  cvtNum(ops[1], charBuf);
+	  cvtNum(ops[2], charBuf);
+	  cvtNum(ops[3], charBuf);
+	  cvtNum(zero, charBuf);
+	  cvtNum(ops[4], charBuf);
 	  charBuf->append((char)8);
 	  k = 5;
 	} else {
 	  k = 0;
 	}
-	for (; k < nOps; k += 4) {
-	  cvtNum(0, gFalse, charBuf);
-	  cvtNum(ops[k].num, ops[k].isFP, charBuf);
-	  cvtNum(ops[k+1].num, ops[k+1].isFP, charBuf);
-	  cvtNum(ops[k+2].num, ops[k+2].isFP, charBuf);
-	  cvtNum(0, gFalse, charBuf);
-	  cvtNum(ops[k+3].num, ops[k+3].isFP, charBuf);
+	for (; k+3 < nOps; k += 4) {
+	  cvtNum(zero, charBuf);
+	  cvtNum(ops[k], charBuf);
+	  cvtNum(ops[k+1], charBuf);
+	  cvtNum(ops[k+2], charBuf);
+	  cvtNum(zero, charBuf);
+	  cvtNum(ops[k+3], charBuf);
 	  charBuf->append((char)8);
 	}
 	nOps = 0;
@@ -1595,25 +1690,25 @@
 	if (nOps < 4 || !(nOps % 4 == 0 || (nOps-1) % 4 == 0)) {
 	  //~ error(-1, "Wrong number of args (%d) to Type 2 hhcurveto", nOps);
 	}
-	if (nOps % 2 == 1) {
-	  cvtNum(ops[1].num, ops[1].isFP, charBuf);
-	  cvtNum(ops[0].num, ops[0].isFP, charBuf);
-	  cvtNum(ops[2].num, ops[2].isFP, charBuf);
-	  cvtNum(ops[3].num, ops[3].isFP, charBuf);
-	  cvtNum(ops[4].num, ops[4].isFP, charBuf);
-	  cvtNum(0, gFalse, charBuf);
+	if (nOps % 2 == 1 && nOps >= 5) {
+	  cvtNum(ops[1], charBuf);
+	  cvtNum(ops[0], charBuf);
+	  cvtNum(ops[2], charBuf);
+	  cvtNum(ops[3], charBuf);
+	  cvtNum(ops[4], charBuf);
+	  cvtNum(zero, charBuf);
 	  charBuf->append((char)8);
 	  k = 5;
 	} else {
 	  k = 0;
 	}
-	for (; k < nOps; k += 4) {
-	  cvtNum(ops[k].num, ops[k].isFP, charBuf);
-	  cvtNum(0, gFalse, charBuf);
-	  cvtNum(ops[k+1].num, ops[k+1].isFP, charBuf);
-	  cvtNum(ops[k+2].num, ops[k+2].isFP, charBuf);
-	  cvtNum(ops[k+3].num, ops[k+3].isFP, charBuf);
-	  cvtNum(0, gFalse, charBuf);
+	for (; k+3 < nOps; k += 4) {
+	  cvtNum(ops[k], charBuf);
+	  cvtNum(zero, charBuf);
+	  cvtNum(ops[k+1], charBuf);
+	  cvtNum(ops[k+2], charBuf);
+	  cvtNum(ops[k+3], charBuf);
+	  cvtNum(zero, charBuf);
 	  charBuf->append((char)8);
 	}
 	nOps = 0;
@@ -1621,7 +1716,7 @@
 	break;
       case 0x001d:		// callgsubr
 	if (nOps >= 1) {
-	  k = gsubrBias + (int)ops[nOps - 1].num;
+	  k = gsubrBias + ops[nOps - 1].toInt();
 	  --nOps;
 	  ok = gTrue;
 	  getIndexVal(&gsubrIdx, k, &val, &ok);
@@ -1637,36 +1732,36 @@
 	if (nOps < 4 || !(nOps % 4 == 0 || (nOps-1) % 4 == 0)) {
 	  //~ error(-1, "Wrong number of args (%d) to Type 2 vhcurveto", nOps);
 	}
-	for (k = 0; k < nOps && k != nOps-5; k += 4) {
+	for (k = 0; k+3 < nOps && k != nOps-5; k += 4) {
 	  if (k % 8 == 0) {
-	    cvtNum(ops[k].num, ops[k].isFP, charBuf);
-	    cvtNum(ops[k+1].num, ops[k+1].isFP, charBuf);
-	    cvtNum(ops[k+2].num, ops[k+2].isFP, charBuf);
-	    cvtNum(ops[k+3].num, ops[k+3].isFP, charBuf);
+	    cvtNum(ops[k], charBuf);
+	    cvtNum(ops[k+1], charBuf);
+	    cvtNum(ops[k+2], charBuf);
+	    cvtNum(ops[k+3], charBuf);
 	    charBuf->append((char)30);
 	  } else {
-	    cvtNum(ops[k].num, ops[k].isFP, charBuf);
-	    cvtNum(ops[k+1].num, ops[k+1].isFP, charBuf);
-	    cvtNum(ops[k+2].num, ops[k+2].isFP, charBuf);
-	    cvtNum(ops[k+3].num, ops[k+3].isFP, charBuf);
+	    cvtNum(ops[k], charBuf);
+	    cvtNum(ops[k+1], charBuf);
+	    cvtNum(ops[k+2], charBuf);
+	    cvtNum(ops[k+3], charBuf);
 	    charBuf->append((char)31);
 	  }
 	}
 	if (k == nOps-5) {
 	  if (k % 8 == 0) {
-	    cvtNum(0, gFalse, charBuf);
-	    cvtNum(ops[k].num, ops[k].isFP, charBuf);
-	    cvtNum(ops[k+1].num, ops[k+1].isFP, charBuf);
-	    cvtNum(ops[k+2].num, ops[k+2].isFP, charBuf);
-	    cvtNum(ops[k+3].num, ops[k+3].isFP, charBuf);
-	    cvtNum(ops[k+4].num, ops[k+4].isFP, charBuf);
+	    cvtNum(zero, charBuf);
+	    cvtNum(ops[k], charBuf);
+	    cvtNum(ops[k+1], charBuf);
+	    cvtNum(ops[k+2], charBuf);
+	    cvtNum(ops[k+3], charBuf);
+	    cvtNum(ops[k+4], charBuf);
 	  } else {
-	    cvtNum(ops[k].num, ops[k].isFP, charBuf);
-	    cvtNum(0, gFalse, charBuf);
-	    cvtNum(ops[k+1].num, ops[k+1].isFP, charBuf);
-	    cvtNum(ops[k+2].num, ops[k+2].isFP, charBuf);
-	    cvtNum(ops[k+4].num, ops[k+4].isFP, charBuf);
-	    cvtNum(ops[k+3].num, ops[k+3].isFP, charBuf);
+	    cvtNum(ops[k], charBuf);
+	    cvtNum(zero, charBuf);
+	    cvtNum(ops[k+1], charBuf);
+	    cvtNum(ops[k+2], charBuf);
+	    cvtNum(ops[k+4], charBuf);
+	    cvtNum(ops[k+3], charBuf);
 	  }
 	  charBuf->append((char)8);
 	}
@@ -1677,36 +1772,36 @@
 	if (nOps < 4 || !(nOps % 4 == 0 || (nOps-1) % 4 == 0)) {
 	  //~ error(-1, "Wrong number of args (%d) to Type 2 hvcurveto", nOps);
 	}
-	for (k = 0; k < nOps && k != nOps-5; k += 4) {
+	for (k = 0; k+3 < nOps && k != nOps-5; k += 4) {
 	  if (k % 8 == 0) {
-	    cvtNum(ops[k].num, ops[k].isFP, charBuf);
-	    cvtNum(ops[k+1].num, ops[k+1].isFP, charBuf);
-	    cvtNum(ops[k+2].num, ops[k+2].isFP, charBuf);
-	    cvtNum(ops[k+3].num, ops[k+3].isFP, charBuf);
+	    cvtNum(ops[k], charBuf);
+	    cvtNum(ops[k+1], charBuf);
+	    cvtNum(ops[k+2], charBuf);
+	    cvtNum(ops[k+3], charBuf);
 	    charBuf->append((char)31);
 	  } else {
-	    cvtNum(ops[k].num, ops[k].isFP, charBuf);
-	    cvtNum(ops[k+1].num, ops[k+1].isFP, charBuf);
-	    cvtNum(ops[k+2].num, ops[k+2].isFP, charBuf);
-	    cvtNum(ops[k+3].num, ops[k+3].isFP, charBuf);
+	    cvtNum(ops[k], charBuf);
+	    cvtNum(ops[k+1], charBuf);
+	    cvtNum(ops[k+2], charBuf);
+	    cvtNum(ops[k+3], charBuf);
 	    charBuf->append((char)30);
 	  }
 	}
 	if (k == nOps-5) {
 	  if (k % 8 == 0) {
-	    cvtNum(ops[k].num, ops[k].isFP, charBuf);
-	    cvtNum(0, gFalse, charBuf);
-	    cvtNum(ops[k+1].num, ops[k+1].isFP, charBuf);
-	    cvtNum(ops[k+2].num, ops[k+2].isFP, charBuf);
-	    cvtNum(ops[k+4].num, ops[k+4].isFP, charBuf);
-	    cvtNum(ops[k+3].num, ops[k+3].isFP, charBuf);
+	    cvtNum(ops[k], charBuf);
+	    cvtNum(zero, charBuf);
+	    cvtNum(ops[k+1], charBuf);
+	    cvtNum(ops[k+2], charBuf);
+	    cvtNum(ops[k+4], charBuf);
+	    cvtNum(ops[k+3], charBuf);
 	  } else {
-	    cvtNum(0, gFalse, charBuf);
-	    cvtNum(ops[k].num, ops[k].isFP, charBuf);
-	    cvtNum(ops[k+1].num, ops[k+1].isFP, charBuf);
-	    cvtNum(ops[k+2].num, ops[k+2].isFP, charBuf);
-	    cvtNum(ops[k+3].num, ops[k+3].isFP, charBuf);
-	    cvtNum(ops[k+4].num, ops[k+4].isFP, charBuf);
+	    cvtNum(zero, charBuf);
+	    cvtNum(ops[k], charBuf);
+	    cvtNum(ops[k+1], charBuf);
+	    cvtNum(ops[k+2], charBuf);
+	    cvtNum(ops[k+3], charBuf);
+	    cvtNum(ops[k+4], charBuf);
 	  }
 	  charBuf->append((char)8);
 	}
@@ -1717,6 +1812,18 @@
 	// ignored
 	nOps = 0;
 	break;
+      case 0x0c0c:		// div
+	if (nOps >= 2) {
+	  num = ops[nOps-2].toInt();
+	  den = ops[nOps-1].toInt();
+	  --nOps;
+	  ops[nOps-1].kind = type1COpRational;
+	  ops[nOps-1].rat.num = num;
+	  ops[nOps-1].rat.den = den;
+	} else {
+	  //~ error(-1, "Wrong number of args (%d) to Type 2 div", nOps);
+	}
+	break;
       case 0x0c03:		// and
       case 0x0c04:		// or
       case 0x0c05:		// not
@@ -1724,7 +1831,6 @@
       case 0x0c09:		// abs
       case 0x0c0a:		// add
       case 0x0c0b:		// sub
-      case 0x0c0c:		// div
       case 0x0c0d:		// load
       case 0x0c0e:		// neg
       case 0x0c0f:		// eq
@@ -1743,96 +1849,141 @@
 	nOps = 0;
 	break;
       case 0x0c22:		// hflex
-	if (nOps != 7) {
+	if (nOps == 7) {
+	  cvtNum(ops[0], charBuf);
+	  cvtNum(zero, charBuf);
+	  cvtNum(ops[1], charBuf);
+	  cvtNum(ops[2], charBuf);
+	  cvtNum(ops[3], charBuf);
+	  cvtNum(zero, charBuf);
+	  charBuf->append((char)8);
+	  cvtNum(ops[4], charBuf);
+	  cvtNum(zero, charBuf);
+	  cvtNum(ops[5], charBuf);
+	  if (ops[2].kind == type1COpInteger) {
+	    tmp.kind = type1COpInteger;
+	    tmp.intgr = -ops[2].intgr;
+	  } else if (ops[2].kind == type1COpRational) {
+	    tmp.kind = type1COpRational;
+	    tmp.rat.num = -ops[2].rat.num;
+	    tmp.rat.den = ops[2].rat.den;
+	  } else {
+	    tmp.kind = type1COpFloat;
+	    tmp.flt = -ops[2].toFloat();
+	  }
+	  cvtNum(tmp, charBuf);
+	  cvtNum(ops[6], charBuf);
+	  cvtNum(zero, charBuf);
+	  charBuf->append((char)8);
+	} else {
 	  //~ error(-1, "Wrong number of args (%d) to Type 2 hflex", nOps);
 	}
-	cvtNum(ops[0].num, ops[0].isFP, charBuf);
-	cvtNum(0, gFalse, charBuf);
-	cvtNum(ops[1].num, ops[1].isFP, charBuf);
-	cvtNum(ops[2].num, ops[2].isFP, charBuf);
-	cvtNum(ops[3].num, ops[3].isFP, charBuf);
-	cvtNum(0, gFalse, charBuf);
-	charBuf->append((char)8);
-	cvtNum(ops[4].num, ops[4].isFP, charBuf);
-	cvtNum(0, gFalse, charBuf);
-	cvtNum(ops[5].num, ops[5].isFP, charBuf);
-	cvtNum(-ops[2].num, ops[2].isFP, charBuf);
-	cvtNum(ops[6].num, ops[6].isFP, charBuf);
-	cvtNum(0, gFalse, charBuf);
-	charBuf->append((char)8);
 	nOps = 0;
 	openPath = gTrue;
 	break;
       case 0x0c23:		// flex
-	if (nOps != 13) {
+	if (nOps == 13) {
+	  cvtNum(ops[0], charBuf);
+	  cvtNum(ops[1], charBuf);
+	  cvtNum(ops[2], charBuf);
+	  cvtNum(ops[3], charBuf);
+	  cvtNum(ops[4], charBuf);
+	  cvtNum(ops[5], charBuf);
+	  charBuf->append((char)8);
+	  cvtNum(ops[6], charBuf);
+	  cvtNum(ops[7], charBuf);
+	  cvtNum(ops[8], charBuf);
+	  cvtNum(ops[9], charBuf);
+	  cvtNum(ops[10], charBuf);
+	  cvtNum(ops[11], charBuf);
+	  charBuf->append((char)8);
+	} else {
 	  //~ error(-1, "Wrong number of args (%d) to Type 2 flex", nOps);
 	}
-	cvtNum(ops[0].num, ops[0].isFP, charBuf);
-	cvtNum(ops[1].num, ops[1].isFP, charBuf);
-	cvtNum(ops[2].num, ops[2].isFP, charBuf);
-	cvtNum(ops[3].num, ops[3].isFP, charBuf);
-	cvtNum(ops[4].num, ops[4].isFP, charBuf);
-	cvtNum(ops[5].num, ops[5].isFP, charBuf);
-	charBuf->append((char)8);
-	cvtNum(ops[6].num, ops[6].isFP, charBuf);
-	cvtNum(ops[7].num, ops[7].isFP, charBuf);
-	cvtNum(ops[8].num, ops[8].isFP, charBuf);
-	cvtNum(ops[9].num, ops[9].isFP, charBuf);
-	cvtNum(ops[10].num, ops[10].isFP, charBuf);
-	cvtNum(ops[11].num, ops[11].isFP, charBuf);
-	charBuf->append((char)8);
 	nOps = 0;
 	openPath = gTrue;
 	break;
       case 0x0c24:		// hflex1
-	if (nOps != 9) {
+	if (nOps == 9) {
+	  cvtNum(ops[0], charBuf);
+	  cvtNum(ops[1], charBuf);
+	  cvtNum(ops[2], charBuf);
+	  cvtNum(ops[3], charBuf);
+	  cvtNum(ops[4], charBuf);
+	  cvtNum(zero, charBuf);
+	  charBuf->append((char)8);
+	  cvtNum(ops[5], charBuf);
+	  cvtNum(zero, charBuf);
+	  cvtNum(ops[6], charBuf);
+	  cvtNum(ops[7], charBuf);
+	  cvtNum(ops[8], charBuf);
+	  if (ops[1].kind == type1COpInteger &&
+	      ops[3].kind == type1COpInteger &&
+	      ops[7].kind == type1COpInteger) {
+	    tmp.kind = type1COpInteger;
+	    tmp.intgr = -(ops[1].intgr + ops[3].intgr + ops[7].intgr);
+	  } else {
+	    tmp.kind = type1COpFloat;
+	    tmp.flt = -(ops[1].toFloat() + ops[3].toFloat() + ops[7].toFloat());
+	  }
+	  cvtNum(tmp, charBuf);
+	  charBuf->append((char)8);
+	} else {
 	  //~ error(-1, "Wrong number of args (%d) to Type 2 hflex1", nOps);
 	}
-	cvtNum(ops[0].num, ops[0].isFP, charBuf);
-	cvtNum(ops[1].num, ops[1].isFP, charBuf);
-	cvtNum(ops[2].num, ops[2].isFP, charBuf);
-	cvtNum(ops[3].num, ops[3].isFP, charBuf);
-	cvtNum(ops[4].num, ops[4].isFP, charBuf);
-	cvtNum(0, gFalse, charBuf);
-	charBuf->append((char)8);
-	cvtNum(ops[5].num, ops[5].isFP, charBuf);
-	cvtNum(0, gFalse, charBuf);
-	cvtNum(ops[6].num, ops[6].isFP, charBuf);
-	cvtNum(ops[7].num, ops[7].isFP, charBuf);
-	cvtNum(ops[8].num, ops[8].isFP, charBuf);
-	cvtNum(-(ops[1].num + ops[3].num + ops[7].num),
-	       ops[1].isFP | ops[3].isFP | ops[7].isFP, charBuf);
-	charBuf->append((char)8);
 	nOps = 0;
 	openPath = gTrue;
 	break;
       case 0x0c25:		// flex1
-	if (nOps != 11) {
+	if (nOps == 11) {
+	  cvtNum(ops[0], charBuf);
+	  cvtNum(ops[1], charBuf);
+	  cvtNum(ops[2], charBuf);
+	  cvtNum(ops[3], charBuf);
+	  cvtNum(ops[4], charBuf);
+	  cvtNum(ops[5], charBuf);
+	  charBuf->append((char)8);
+	  cvtNum(ops[6], charBuf);
+	  cvtNum(ops[7], charBuf);
+	  cvtNum(ops[8], charBuf);
+	  cvtNum(ops[9], charBuf);
+	  dx = ops[0].toFloat() + ops[2].toFloat() + ops[4].toFloat()
+	       + ops[6].toFloat() + ops[8].toFloat();
+	  dy = ops[1].toFloat() + ops[3].toFloat() + ops[5].toFloat()
+	       + ops[7].toFloat() + ops[9].toFloat();
+	  if (fabs(dx) > fabs(dy)) {
+	    cvtNum(ops[10], charBuf);
+	    if (ops[1].kind == type1COpInteger &&
+		ops[3].kind == type1COpInteger &&
+		ops[5].kind == type1COpInteger &&
+		ops[7].kind == type1COpInteger &&
+		ops[9].kind == type1COpInteger) {
+	      tmp.kind = type1COpInteger;
+	      tmp.intgr = -(int)dy;
+	    } else {
+	      tmp.kind = type1COpFloat;
+	      tmp.flt = -dy;
+	    }
+	    cvtNum(tmp, charBuf);
+	  } else {
+	    if (ops[0].kind == type1COpInteger &&
+		ops[2].kind == type1COpInteger &&
+		ops[4].kind == type1COpInteger &&
+		ops[6].kind == type1COpInteger &&
+		ops[8].kind == type1COpInteger) {
+	      tmp.kind = type1COpInteger;
+	      tmp.intgr = -(int)dx;
+	    } else {
+	      tmp.kind = type1COpFloat;
+	      tmp.flt = -dx;
+	    }
+	    cvtNum(tmp, charBuf);
+	    cvtNum(ops[10], charBuf);
+	  }
+	  charBuf->append((char)8);
+	} else {
 	  //~ error(-1, "Wrong number of args (%d) to Type 2 flex1", nOps);
 	}
-	cvtNum(ops[0].num, ops[0].isFP, charBuf);
-	cvtNum(ops[1].num, ops[1].isFP, charBuf);
-	cvtNum(ops[2].num, ops[2].isFP, charBuf);
-	cvtNum(ops[3].num, ops[3].isFP, charBuf);
-	cvtNum(ops[4].num, ops[4].isFP, charBuf);
-	cvtNum(ops[5].num, ops[5].isFP, charBuf);
-	charBuf->append((char)8);
-	cvtNum(ops[6].num, ops[6].isFP, charBuf);
-	cvtNum(ops[7].num, ops[7].isFP, charBuf);
-	cvtNum(ops[8].num, ops[8].isFP, charBuf);
-	cvtNum(ops[9].num, ops[9].isFP, charBuf);
-	dx = ops[0].num + ops[2].num + ops[4].num + ops[6].num + ops[8].num;
-	dy = ops[1].num + ops[3].num + ops[5].num + ops[7].num + ops[9].num;
-	if (fabs(dx) > fabs(dy)) {
-	  cvtNum(ops[10].num, ops[10].isFP, charBuf);
-	  cvtNum(-dy, ops[1].isFP | ops[3].isFP | ops[5].isFP |
-		      ops[7].isFP | ops[9].isFP, charBuf);
-	} else {
-	  cvtNum(-dx, ops[0].isFP | ops[2].isFP | ops[4].isFP |
-		      ops[6].isFP | ops[8].isFP, charBuf);
-	  cvtNum(ops[10].num, ops[10].isFP, charBuf);
-	}
-	charBuf->append((char)8);
 	nOps = 0;
 	openPath = gTrue;
 	break;
@@ -1858,52 +2009,46 @@
 
 void FoFiType1C::cvtGlyphWidth(GBool useOp, GString *charBuf,
 			       Type1CPrivateDict *pDict) {
-  double w;
-  GBool wFP;
+  Type1COp zero, w;
   int i;
 
   if (useOp) {
-    w = pDict->nominalWidthX + ops[0].num;
-    wFP = pDict->nominalWidthXFP | ops[0].isFP;
+    if (pDict->nominalWidthXInt & (ops[0].kind == type1COpInteger)) {
+      w.kind = type1COpInteger;
+      w.intgr = (int)(pDict->nominalWidthX + ops[0].intgr);
+    } else {
+      w.kind = type1COpFloat;
+      w.flt = pDict->nominalWidthX + ops[0].toFloat();
+    }
     for (i = 1; i < nOps; ++i) {
       ops[i-1] = ops[i];
     }
     --nOps;
   } else {
-    w = pDict->defaultWidthX;
-    wFP = pDict->defaultWidthXFP;
+    if (pDict->defaultWidthXInt) {
+      w.kind = type1COpInteger;
+      w.intgr = (int)pDict->defaultWidthX;
+    } else {
+      w.kind = type1COpFloat;
+      w.flt = pDict->defaultWidthX;
+    }
   }
-  cvtNum(0, gFalse, charBuf);
-  cvtNum(w, wFP, charBuf);
+  zero.kind = type1COpInteger;
+  zero.intgr = 0;
+  cvtNum(zero, charBuf);
+  cvtNum(w, charBuf);
   charBuf->append((char)13);
 }
 
-void FoFiType1C::cvtNum(double x, GBool isFP, GString *charBuf) {
+void FoFiType1C::cvtNum(Type1COp op, GString *charBuf) {
+  Type1COp tmp;
   Guchar buf[12];
   int y, n;
 
   n = 0;
-  if (isFP) {
-    if (x >= -32768 && x < 32768) {
-      y = (int)(x * 256.0);
-      buf[0] = 255;
-      buf[1] = (Guchar)(y >> 24);
-      buf[2] = (Guchar)(y >> 16);
-      buf[3] = (Guchar)(y >> 8);
-      buf[4] = (Guchar)y;
-      buf[5] = 255;
-      buf[6] = 0;
-      buf[7] = 0;
-      buf[8] = 1;
-      buf[9] = 0;
-      buf[10] = 12;
-      buf[11] = 12;
-      n = 12;
-    } else {
-      //~ error(-1, "Type 2 fixed point constant out of range");
-    }
-  } else {
-    y = (int)x;
+  switch (op.kind) {
+  case type1COpInteger:
+    y = op.intgr;
     if (y >= -107 && y <= 107) {
       buf[0] = (Guchar)(y + 139);
       n = 1;
@@ -1925,6 +2070,39 @@
       buf[4] = (Guchar)y;
       n = 5;
     }
+    break;
+  case type1COpFloat:
+    if (op.flt >= -32768 && op.flt < 32768) {
+      y = (int)(op.flt * 256.0);
+      buf[0] = 255;
+      buf[1] = (Guchar)(y >> 24);
+      buf[2] = (Guchar)(y >> 16);
+      buf[3] = (Guchar)(y >> 8);
+      buf[4] = (Guchar)y;
+      buf[5] = 255;
+      buf[6] = 0;
+      buf[7] = 0;
+      buf[8] = 1;
+      buf[9] = 0;
+      buf[10] = 12;
+      buf[11] = 12;
+      n = 12;
+    } else {
+      //~ error(-1, "Type 2 fixed point constant out of range");
+    }
+    break;
+  case type1COpRational:
+    tmp.kind = type1COpInteger;
+    tmp.intgr = op.rat.num;
+    cvtNum(tmp, charBuf);
+    tmp.intgr = op.rat.den;
+    cvtNum(tmp, charBuf);
+    buf[0] = 0x0c;
+    buf[1] = 0x0c;
+    n = 2;
+    break;
+  default: // shouldn't happen
+    break;
   }
   charBuf->append((char *)buf, n);
 }
@@ -2161,47 +2339,51 @@
     if (!parsedOk) {
       break;
     }
-    if (!ops[nOps - 1].isNum) {
+    if (ops[nOps - 1].kind == type1COpOperator) {
       --nOps; // drop the operator
       if (topDict.firstOp < 0) {
 	topDict.firstOp = ops[nOps].op;
       }
       switch (ops[nOps].op) {
-      case 0x0000: topDict.versionSID = (int)ops[0].num; break;
-      case 0x0001: topDict.noticeSID = (int)ops[0].num; break;
-      case 0x0c00: topDict.copyrightSID = (int)ops[0].num; break;
-      case 0x0002: topDict.fullNameSID = (int)ops[0].num; break;
-      case 0x0003: topDict.familyNameSID = (int)ops[0].num; break;
-      case 0x0004: topDict.weightSID = (int)ops[0].num; break;
-      case 0x0c01: topDict.isFixedPitch = (int)ops[0].num; break;
-      case 0x0c02: topDict.italicAngle = ops[0].num; break;
-      case 0x0c03: topDict.underlinePosition = ops[0].num; break;
-      case 0x0c04: topDict.underlineThickness = ops[0].num; break;
-      case 0x0c05: topDict.paintType = (int)ops[0].num; break;
-      case 0x0c06: topDict.charstringType = (int)ops[0].num; break;
-      case 0x0c07: topDict.fontMatrix[0] = ops[0].num;
-	           topDict.fontMatrix[1] = ops[1].num;
-	           topDict.fontMatrix[2] = ops[2].num;
-	           topDict.fontMatrix[3] = ops[3].num;
-	           topDict.fontMatrix[4] = ops[4].num;
-	           topDict.fontMatrix[5] = ops[5].num;
-		   topDict.hasFontMatrix = gTrue; break;
-      case 0x000d: topDict.uniqueID = (int)ops[0].num; break;
-      case 0x0005: topDict.fontBBox[0] = ops[0].num;
-	           topDict.fontBBox[1] = ops[1].num;
-	           topDict.fontBBox[2] = ops[2].num;
-	           topDict.fontBBox[3] = ops[3].num; break;
-      case 0x0c08: topDict.strokeWidth = ops[0].num; break;
-      case 0x000f: topDict.charsetOffset = (int)ops[0].num; break;
-      case 0x0010: topDict.encodingOffset = (int)ops[0].num; break;
-      case 0x0011: topDict.charStringsOffset = (int)ops[0].num; break;
-      case 0x0012: topDict.privateSize = (int)ops[0].num;
-	           topDict.privateOffset = (int)ops[1].num; break;
-      case 0x0c1e: topDict.registrySID = (int)ops[0].num;
-	           topDict.orderingSID = (int)ops[1].num;
-		   topDict.supplement = (int)ops[2].num; break;
-      case 0x0c24: topDict.fdArrayOffset = (int)ops[0].num; break;
-      case 0x0c25: topDict.fdSelectOffset = (int)ops[0].num; break;
+      case 0x0000: topDict.versionSID = ops[0].toInt(); break;
+      case 0x0001: topDict.noticeSID = ops[0].toInt(); break;
+      case 0x0c00: topDict.copyrightSID = ops[0].toInt(); break;
+      case 0x0002: topDict.fullNameSID = ops[0].toInt(); break;
+      case 0x0003: topDict.familyNameSID = ops[0].toInt(); break;
+      case 0x0004: topDict.weightSID = ops[0].toInt(); break;
+      case 0x0c01: topDict.isFixedPitch = ops[0].toInt(); break;
+      case 0x0c02: topDict.italicAngle = ops[0].toFloat(); break;
+      case 0x0c03: topDict.underlinePosition = ops[0].toFloat(); break;
+      case 0x0c04: topDict.underlineThickness = ops[0].toFloat(); break;
+      case 0x0c05: topDict.paintType = ops[0].toInt(); break;
+      case 0x0c06: topDict.charstringType = ops[0].toInt(); break;
+      case 0x0c07: topDict.fontMatrix[0] = ops[0].toFloat();
+	           topDict.fontMatrix[1] = ops[1].toFloat();
+	           topDict.fontMatrix[2] = ops[2].toFloat();
+	           topDict.fontMatrix[3] = ops[3].toFloat();
+	           topDict.fontMatrix[4] = ops[4].toFloat();
+	           topDict.fontMatrix[5] = ops[5].toFloat();
+		   topDict.hasFontMatrix = gTrue;
+		   break;
+      case 0x000d: topDict.uniqueID = ops[0].toInt(); break;
+      case 0x0005: topDict.fontBBox[0] = ops[0].toFloat();
+	           topDict.fontBBox[1] = ops[1].toFloat();
+	           topDict.fontBBox[2] = ops[2].toFloat();
+	           topDict.fontBBox[3] = ops[3].toFloat();
+		   break;
+      case 0x0c08: topDict.strokeWidth = ops[0].toFloat(); break;
+      case 0x000f: topDict.charsetOffset = ops[0].toInt(); break;
+      case 0x0010: topDict.encodingOffset = ops[0].toInt(); break;
+      case 0x0011: topDict.charStringsOffset = ops[0].toInt(); break;
+      case 0x0012: topDict.privateSize = ops[0].toInt();
+	           topDict.privateOffset = ops[1].toInt();
+		   break;
+      case 0x0c1e: topDict.registrySID = ops[0].toInt();
+	           topDict.orderingSID = ops[1].toInt();
+		   topDict.supplement = ops[2].toInt();
+		   break;
+      case 0x0c24: topDict.fdArrayOffset = ops[0].toInt(); break;
+      case 0x0c25: topDict.fdSelectOffset = ops[0].toInt(); break;
       }
       nOps = 0;
     }
@@ -2227,22 +2409,22 @@
     if (!parsedOk) {
       return;
     }
-    if (!ops[nOps - 1].isNum) {
+    if (ops[nOps - 1].kind == type1COpOperator) {
       if (ops[nOps - 1].op == 0x0012) {
 	if (nOps < 3) {
 	  parsedOk = gFalse;
 	  return;
 	}
-	pSize = (int)ops[0].num;
-	pOffset = (int)ops[1].num;
+	pSize = ops[0].toInt();
+	pOffset = ops[1].toInt();
 	break;
       } else if (ops[nOps - 1].op == 0x0c07) {
-	fontMatrix[0] = ops[0].num;
-	fontMatrix[1] = ops[1].num;
-	fontMatrix[2] = ops[2].num;
-	fontMatrix[3] = ops[3].num;
-	fontMatrix[4] = ops[4].num;
-	fontMatrix[5] = ops[5].num;
+	fontMatrix[0] = ops[0].toFloat();
+	fontMatrix[1] = ops[1].toFloat();
+	fontMatrix[2] = ops[2].toFloat();
+	fontMatrix[3] = ops[3].toFloat();
+	fontMatrix[4] = ops[4].toFloat();
+	fontMatrix[5] = ops[5].toFloat();
 	hasFontMatrix = gTrue;
       }
       nOps = 0;
@@ -2283,9 +2465,9 @@
   pDict->initialRandomSeed = 0;
   pDict->subrsOffset = 0;
   pDict->defaultWidthX = 0;
-  pDict->defaultWidthXFP = gFalse;
+  pDict->defaultWidthXInt = gTrue;
   pDict->nominalWidthX = 0;
-  pDict->nominalWidthXFP = gFalse;
+  pDict->nominalWidthXInt = gTrue;
 
   // no dictionary
   if (offset == 0 || length == 0) {
@@ -2299,7 +2481,7 @@
     if (!parsedOk) {
       break;
     }
-    if (!ops[nOps - 1].isNum) {
+    if (ops[nOps - 1].kind == type1COpOperator) {
       --nOps; // drop the operator
       switch (ops[nOps].op) {
       case 0x0006:
@@ -2319,20 +2501,20 @@
 						    type1CMaxOtherBlues);
 	break;
       case 0x0c09:
-	pDict->blueScale = ops[0].num;
+	pDict->blueScale = ops[0].toFloat();
 	break;
       case 0x0c0a:
-	pDict->blueShift = (int)ops[0].num;
+	pDict->blueShift = ops[0].toInt();
 	break;
       case 0x0c0b:
-	pDict->blueFuzz = (int)ops[0].num;
+	pDict->blueFuzz = ops[0].toInt();
 	break;
       case 0x000a:
-	pDict->stdHW = ops[0].num;
+	pDict->stdHW = ops[0].toFloat();
 	pDict->hasStdHW = gTrue;
 	break;
       case 0x000b:
-	pDict->stdVW = ops[0].num;
+	pDict->stdVW = ops[0].toFloat();
 	pDict->hasStdVW = gTrue;
 	break;
       case 0x0c0c:
@@ -2344,31 +2526,31 @@
 					    type1CMaxStemSnap);
 	break;
       case 0x0c0e:
-	pDict->forceBold = ops[0].num != 0;
+	pDict->forceBold = !ops[0].isZero();
 	pDict->hasForceBold = gTrue;
 	break;
       case 0x0c0f:
-	pDict->forceBoldThreshold = ops[0].num;
+	pDict->forceBoldThreshold = ops[0].toFloat();
 	break;
       case 0x0c11:
-	pDict->languageGroup = (int)ops[0].num;
+	pDict->languageGroup = ops[0].toInt();
 	break;
       case 0x0c12:
-	pDict->expansionFactor = ops[0].num;
+	pDict->expansionFactor = ops[0].toFloat();
 	break;
       case 0x0c13:
-	pDict->initialRandomSeed = (int)ops[0].num;
+	pDict->initialRandomSeed = ops[0].toInt();
 	break;
       case 0x0013:
-	pDict->subrsOffset = offset + (int)ops[0].num;
+	pDict->subrsOffset = offset + ops[0].toInt();
 	break;
       case 0x0014:
-	pDict->defaultWidthX = ops[0].num;
-	pDict->defaultWidthXFP = ops[0].isFP;
+	pDict->defaultWidthX = ops[0].toFloat();
+	pDict->defaultWidthXInt = ops[0].kind == type1COpInteger;
 	break;
       case 0x0015:
-	pDict->nominalWidthX = ops[0].num;
-	pDict->nominalWidthXFP = ops[0].isFP;
+	pDict->nominalWidthX = ops[0].toFloat();
+	pDict->nominalWidthXInt = ops[0].kind == type1COpInteger;
 	break;
       }
       nOps = 0;
@@ -2584,8 +2766,6 @@
   int b0, b1, nyb0, nyb1, x, i;
 
   b0 = getU8(pos++, ok);
-  op.isNum = gTrue;
-  op.isFP = gFalse;
 
   if (b0 == 28) {
     x = getU8(pos++, ok);
@@ -2593,7 +2773,8 @@
     if (x & 0x8000) {
       x |= ~0xffff;
     }
-    op.num = x;
+    op.kind = type1COpInteger;
+    op.intgr = x;
 
   } else if (!charstring && b0 == 29) {
     x = getU8(pos++, ok);
@@ -2603,7 +2784,8 @@
     if (x & 0x80000000) {
       x |= ~0xffffffff;
     }
-    op.num = x;
+    op.kind = type1COpInteger;
+    op.intgr = x;
 
   } else if (!charstring && b0 == 30) {
     i = 0;
@@ -2636,17 +2818,20 @@
       }
     } while (i < 64);
     buf[i] = '\0';
-    op.num = atof(buf);
-    op.isFP = gTrue;
+    op.kind = type1COpFloat;
+    op.flt = atof(buf);
 
   } else if (b0 >= 32 && b0 <= 246) {
-    op.num = b0 - 139;
+    op.kind = type1COpInteger;
+    op.intgr = b0 - 139;
 
   } else if (b0 >= 247 && b0 <= 250) {
-    op.num = ((b0 - 247) << 8) + getU8(pos++, ok) + 108;
+    op.kind = type1COpInteger;
+    op.intgr = ((b0 - 247) << 8) + getU8(pos++, ok) + 108;
 
   } else if (b0 >= 251 && b0 <= 254) {
-    op.num = -((b0 - 251) << 8) - getU8(pos++, ok) - 108;
+    op.kind = type1COpInteger;
+    op.intgr = -((b0 - 251) << 8) - getU8(pos++, ok) - 108;
 
   } else if (charstring && b0 == 255) {
     x = getU8(pos++, ok);
@@ -2656,15 +2841,15 @@
     if (x & 0x80000000) {
       x |= ~0xffffffff;
     }
-    op.num = (double)x / 65536.0;
-    op.isFP = gTrue;
+    op.kind = type1COpFloat;
+    op.flt = (double)x / 65536.0;
 
   } else if (b0 == 12) {
-    op.isNum = gFalse;
+    op.kind = type1COpOperator;
     op.op = 0x0c00 + getU8(pos++, ok);
 
   } else {
-    op.isNum = gFalse;
+    op.kind = type1COpOperator;
     op.op = b0;
   }
 
@@ -2685,7 +2870,7 @@
   }
   x = 0;
   for (i = 0; i < n; ++i) {
-    x += (int)ops[i].num;
+    x += ops[i].toInt();
     arr[i] = x;
   }
   return n;
@@ -2701,7 +2886,7 @@
   }
   x = 0;
   for (i = 0; i < n; ++i) {
-    x += ops[i].num;
+    x += ops[i].toFloat();
     arr[i] = x;
   }
   return n;
@@ -2736,6 +2921,8 @@
   int pos0, pos1;
 
   if (i < 0 || i >= idx->len) {
+    val->pos = 0;
+    val->len = 0;
     *ok = gFalse;
     return;
   }

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/fofi/FoFiType1C.h
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/fofi/FoFiType1C.h	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/fofi/FoFiType1C.h	2017-11-01 18:15:56 UTC (rev 780)
@@ -105,18 +105,34 @@
   int initialRandomSeed;
   int subrsOffset;
   double defaultWidthX;
-  GBool defaultWidthXFP;
+  GBool defaultWidthXInt;
   double nominalWidthX;
-  GBool nominalWidthXFP;
+  GBool nominalWidthXInt;
 };
 
+// operand kind
+enum Type1COpKind {
+  type1COpOperator,
+  type1COpInteger,
+  type1COpFloat,
+  type1COpRational
+};
+
+// operand
 struct Type1COp {
-  GBool isNum;			// true -> number, false -> operator
-  GBool isFP;			// true -> floating point number, false -> int
+  Type1COpKind kind;
   union {
-    double num;			// if num is true
-    int op;			// if num is false
+    int op;			// type1COpOperator
+    int intgr;			// type1COpInteger
+    double flt;			// type1COpFloat
+    struct {
+      int num, den;		// type1COpRational
+    } rat;
   };
+  GBool isZero();
+  GBool isNegative();
+  int toInt();
+  double toFloat();
 };
 
 struct Type1CEexecBuf {
@@ -204,7 +220,7 @@
 		GBool top);
   void cvtGlyphWidth(GBool useOp, GString *charBuf,
 		     Type1CPrivateDict *pDict);
-  void cvtNum(double x, GBool isFP, GString *charBuf);
+  void cvtNum(Type1COp op, GString *charBuf);
   void eexecWrite(Type1CEexecBuf *eb, const char *s);
   void eexecWriteCharstring(Type1CEexecBuf *eb, Guchar *s, int n);
   void writePSString(char *s, FoFiOutputFunc outputFunc, void *outputStream);

Deleted: branches/stable/source/src/libs/xpdf/xpdf-src/fofi/Makefile.dep
===================================================================
Deleted: branches/stable/source/src/libs/xpdf/xpdf-src/fofi/Makefile.in
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/fofi/Makefile.in	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/fofi/Makefile.in	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,71 +0,0 @@
-#========================================================================
-#
-# FoFi library Makefile
-#
-# Copyright 2003 Glyph & Cog, LLC
-#
-#========================================================================
-
-SHELL = /bin/sh
-
-srcdir = @srcdir@
-VPATH = @srcdir@
-
-GOOSRCDIR = $(srcdir)/../goo
-GOOLIBDIR = ../goo
-
-CXXFLAGS = @CXXFLAGS@ @DEFS@ -I.. -I$(srcdir)/.. -I$(GOOSRCDIR) -I$(srcdir)
-
-CXX = @CXX@
-AR = @AR@
-RANLIB = @RANLIB@
-
-LIBPREFIX = @LIBPREFIX@
-
-#------------------------------------------------------------------------
-
-.SUFFIXES: .cc
-
-.cc.o:
-	$(CXX) $(CXXFLAGS) -c $<
-
-#------------------------------------------------------------------------
-
-CXX_SRC = \
-	$(srcdir)/FoFiBase.cc \
-	$(srcdir)/FoFiEncodings.cc \
-	$(srcdir)/FoFiIdentifier.cc \
-	$(srcdir)/FoFiTrueType.cc \
-	$(srcdir)/FoFiType1.cc \
-	$(srcdir)/FoFiType1C.cc
-
-#------------------------------------------------------------------------
-
-all: $(LIBPREFIX)fofi.a
-
-#------------------------------------------------------------------------
-
-FOFI_OBJS = \
-	FoFiBase.o \
-	FoFiEncodings.o \
-	FoFiIdentifier.o \
-	FoFiTrueType.o \
-	FoFiType1.o \
-	FoFiType1C.o
-
-$(LIBPREFIX)fofi.a: $(FOFI_OBJS)
-	rm -f $(LIBPREFIX)fofi.a
-	$(AR) $(LIBPREFIX)fofi.a $(FOFI_OBJS)
-	$(RANLIB) $(LIBPREFIX)fofi.a
-
-#------------------------------------------------------------------------
-
-clean:
-	rm -f $(FOFI_OBJS) $(LIBPREFIX)fofi.a
-
-#------------------------------------------------------------------------
-
-depend:
-	$(CXX) $(CXXFLAGS) -MM $(CXX_SRC) >Makefile.dep
-
--include Makefile.dep

Added: branches/stable/source/src/libs/xpdf/xpdf-src/goo/CMakeLists.txt
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/goo/CMakeLists.txt	                        (rev 0)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/goo/CMakeLists.txt	2017-11-01 18:15:56 UTC (rev 780)
@@ -0,0 +1,27 @@
+#========================================================================
+#
+# goo/CMakeLists.txt
+#
+# CMake script for the goo library.
+#
+# Copyright 2015 Glyph & Cog, LLC
+#
+#========================================================================
+
+include_directories("${PROJECT_SOURCE_DIR}")
+include_directories("${PROJECT_BINARY_DIR}")
+
+add_library(goo_objs OBJECT
+  FixedPoint.cc
+  GHash.cc
+  GList.cc
+  GString.cc
+  gfile.cc
+  gmem.cc
+  gmempp.cc
+  parseargs.c
+)
+
+add_library(goo
+  $<TARGET_OBJECTS:goo_objs>
+)


Property changes on: branches/stable/source/src/libs/xpdf/xpdf-src/goo/CMakeLists.txt
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: branches/stable/source/src/libs/xpdf/xpdf-src/goo/FixedPoint.cc
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/goo/FixedPoint.cc	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/goo/FixedPoint.cc	2017-11-01 18:15:56 UTC (rev 780)
@@ -16,6 +16,7 @@
 #pragma implementation
 #endif
 
+#include "gmempp.h"
 #include "FixedPoint.h"
 
 #define ln2 ((FixedPoint)0.69314718)
@@ -113,7 +114,7 @@
       z >= ((FixPtInt64)1 << 31) || z < -((FixPtInt64)1 << 31)) {
     return gFalse;
   }
-  result->val = z;
+  result->val = (int)z;
   return gTrue;
 }
 

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/goo/FixedPoint.h
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/goo/FixedPoint.h	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/goo/FixedPoint.h	2017-11-01 18:15:56 UTC (rev 780)
@@ -49,35 +49,35 @@
 
   FixedPoint operator =(FixedPoint x) { val = x.val; return *this; }
 
-  int operator ==(FixedPoint x) const { return val == x.val; }
-  int operator ==(double x) const { return *this == (FixedPoint)x; }
-  int operator ==(int x) const { return *this == (FixedPoint)x; }
-  int operator ==(long x) const { return *this == (FixedPoint)x; }
+  bool operator ==(FixedPoint x) const { return val == x.val; }
+  bool operator ==(double x) const { return *this == (FixedPoint)x; }
+  bool operator ==(int x) const { return *this == (FixedPoint)x; }
+  bool operator ==(long x) const { return *this == (FixedPoint)x; }
 
-  int operator !=(FixedPoint x) const { return val != x.val; }
-  int operator !=(double x) const { return *this != (FixedPoint)x; }
-  int operator !=(int x) const { return *this != (FixedPoint)x; }
-  int operator !=(long x) const { return *this != (FixedPoint)x; }
+  bool operator !=(FixedPoint x) const { return val != x.val; }
+  bool operator !=(double x) const { return *this != (FixedPoint)x; }
+  bool operator !=(int x) const { return *this != (FixedPoint)x; }
+  bool operator !=(long x) const { return *this != (FixedPoint)x; }
 
-  int operator <(FixedPoint x) const { return val < x.val; }
-  int operator <(double x) const { return *this < (FixedPoint)x; }
-  int operator <(int x) const { return *this < (FixedPoint)x; }
-  int operator <(long x) const { return *this < (FixedPoint)x; }
+  bool operator <(FixedPoint x) const { return val < x.val; }
+  bool operator <(double x) const { return *this < (FixedPoint)x; }
+  bool operator <(int x) const { return *this < (FixedPoint)x; }
+  bool operator <(long x) const { return *this < (FixedPoint)x; }
 
-  int operator <=(FixedPoint x) const { return val <= x.val; }
-  int operator <=(double x) const { return *this <= (FixedPoint)x; }
-  int operator <=(int x) const { return *this <= (FixedPoint)x; }
-  int operator <=(long x) const { return *this <= (FixedPoint)x; }
+  bool operator <=(FixedPoint x) const { return val <= x.val; }
+  bool operator <=(double x) const { return *this <= (FixedPoint)x; }
+  bool operator <=(int x) const { return *this <= (FixedPoint)x; }
+  bool operator <=(long x) const { return *this <= (FixedPoint)x; }
 
-  int operator >(FixedPoint x) const { return val > x.val; }
-  int operator >(double x) const { return *this > (FixedPoint)x; }
-  int operator >(int x) const { return *this > (FixedPoint)x; }
-  int operator >(long x) const { return *this > (FixedPoint)x; }
+  bool operator >(FixedPoint x) const { return val > x.val; }
+  bool operator >(double x) const { return *this > (FixedPoint)x; }
+  bool operator >(int x) const { return *this > (FixedPoint)x; }
+  bool operator >(long x) const { return *this > (FixedPoint)x; }
 
-  int operator >=(FixedPoint x) const { return val >= x.val; }
-  int operator >=(double x) const { return *this >= (FixedPoint)x; }
-  int operator >=(int x) const { return *this >= (FixedPoint)x; }
-  int operator >=(long x) const { return *this >= (FixedPoint)x; }
+  bool operator >=(FixedPoint x) const { return val >= x.val; }
+  bool operator >=(double x) const { return *this >= (FixedPoint)x; }
+  bool operator >=(int x) const { return *this >= (FixedPoint)x; }
+  bool operator >=(long x) const { return *this >= (FixedPoint)x; }
 
   FixedPoint operator -() { return make(-val); }
 
@@ -136,7 +136,6 @@
   static FixedPoint avg(FixedPoint x, FixedPoint y)
     { return make((x.val >> 1) + (y.val >> 1) + ((x.val | y.val) & 1)); }
 
-
   static FixedPoint sqrt(FixedPoint x);
 
   static FixedPoint pow(FixedPoint x, FixedPoint y);

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/goo/GHash.cc
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/goo/GHash.cc	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/goo/GHash.cc	2017-11-01 18:15:56 UTC (rev 780)
@@ -13,6 +13,7 @@
 #endif
 
 #include "gmem.h"
+#include "gmempp.h"
 #include "GString.h"
 #include "GHash.h"
 

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/goo/GList.cc
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/goo/GList.cc	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/goo/GList.cc	2017-11-01 18:15:56 UTC (rev 780)
@@ -15,6 +15,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include "gmem.h"
+#include "gmempp.h"
 #include "GList.h"
 
 //------------------------------------------------------------------------

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/goo/GMutex.h
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/goo/GMutex.h	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/goo/GMutex.h	2017-11-01 18:15:56 UTC (rev 780)
@@ -3,8 +3,9 @@
 // GMutex.h
 //
 // Portable mutex macros.
+// Portable atomic increment/decrement.
 //
-// Copyright 2002-2003 Glyph & Cog, LLC
+// Copyright 2002-2014 Glyph & Cog, LLC
 //
 //========================================================================
 
@@ -11,6 +12,17 @@
 #ifndef GMUTEX_H
 #define GMUTEX_H
 
+#ifdef _WIN32
+#  include <windows.h>
+#  include <intrin.h>
+#else
+#  include <pthread.h>
+#endif
+
+//------------------------------------------------------------------------
+// GMutex
+//------------------------------------------------------------------------
+
 // Usage:
 //
 // GMutex m;
@@ -24,8 +36,6 @@
 
 #ifdef _WIN32
 
-#include <windows.h>
-
 typedef CRITICAL_SECTION GMutex;
 
 #define gInitMutex(m) InitializeCriticalSection(m)
@@ -35,8 +45,6 @@
 
 #else // assume pthreads
 
-#include <pthread.h>
-
 typedef pthread_mutex_t GMutex;
 
 #define gInitMutex(m) pthread_mutex_init(m, NULL)
@@ -46,4 +54,41 @@
 
 #endif
 
+//------------------------------------------------------------------------
+// atomic increment/decrement
+//------------------------------------------------------------------------
+
+// NB: this must be "long" to work on Windows
+typedef long GAtomicCounter;
+
+// Increment *counter by one and return the final value (after the
+// increment).
+static inline GAtomicCounter gAtomicIncrement(GAtomicCounter *counter) {
+  GAtomicCounter newVal;
+
+#if defined(_WIN32)
+  newVal = _InterlockedIncrement(counter);
+#elif defined(__GNUC__) // this also works for LLVM/clang
+  newVal = __sync_add_and_fetch(counter, 1);
+#else
+#  error "gAtomicIncrement is not defined for this compiler/platform"
 #endif
+  return newVal;
+}
+
+// Decrement *counter by one and return the final value (after the
+// decrement).
+static inline GAtomicCounter gAtomicDecrement(GAtomicCounter *counter) {
+  GAtomicCounter newVal;
+
+#if defined(_WIN32)
+  newVal = _InterlockedDecrement(counter);
+#elif defined(__GNUC__) // this also works for LLVM/clang
+  newVal = __sync_sub_and_fetch(counter, 1);
+#else
+#  error "gAtomicDecrement is not defined for this compiler/platform"
+#endif
+  return newVal;
+}
+
+#endif // GMUTEX_H

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/goo/GString.cc
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/goo/GString.cc	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/goo/GString.cc	2017-11-01 18:15:56 UTC (rev 780)
@@ -21,6 +21,7 @@
 #include <math.h>
 #include <limits.h>
 #include "gmem.h"
+#include "gmempp.h"
 #include "GString.h"
 
 //------------------------------------------------------------------------
@@ -755,8 +756,9 @@
   int i;
 
   for (i = 0; i < length; ++i) {
-    if (islower(s[i]))
-      s[i] = toupper(s[i]);
+    if (islower(s[i] & 0xff)) {
+      s[i] = toupper(s[i] & 0xff);
+    }
   }
   return this;
 }
@@ -765,8 +767,9 @@
   int i;
 
   for (i = 0; i < length; ++i) {
-    if (isupper(s[i]))
-      s[i] = tolower(s[i]);
+    if (isupper(s[i] & 0xff)) {
+      s[i] = tolower(s[i] & 0xff);
+    }
   }
   return this;
 }
@@ -778,7 +781,7 @@
   n1 = length;
   n2 = str->length;
   for (i = 0, p1 = s, p2 = str->s; i < n1 && i < n2; ++i, ++p1, ++p2) {
-    x = *p1 - *p2;
+    x = (*p1 & 0xff) - (*p2 & 0xff);
     if (x != 0) {
       return x;
     }
@@ -795,7 +798,7 @@
   for (i = 0, p1 = s, p2 = str->s;
        i < n1 && i < n2 && i < n;
        ++i, ++p1, ++p2) {
-    x = *p1 - *p2;
+    x = (*p1 & 0xff) - (*p2 & 0xff);
     if (x != 0) {
       return x;
     }
@@ -812,7 +815,7 @@
 
   n1 = length;
   for (i = 0, p1 = s, p2 = sA; i < n1 && *p2; ++i, ++p1, ++p2) {
-    x = *p1 - *p2;
+    x = (*p1 & 0xff) - (*p2 & 0xff);
     if (x != 0) {
       return x;
     }
@@ -832,7 +835,7 @@
 
   n1 = length;
   for (i = 0, p1 = s, p2 = sA; i < n1 && *p2 && i < n; ++i, ++p1, ++p2) {
-    x = *p1 - *p2;
+    x = (*p1 & 0xff) - (*p2 & 0xff);
     if (x != 0) {
       return x;
     }

Deleted: branches/stable/source/src/libs/xpdf/xpdf-src/goo/Makefile.dep
===================================================================
Deleted: branches/stable/source/src/libs/xpdf/xpdf-src/goo/Makefile.in
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/goo/Makefile.in	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/goo/Makefile.in	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,71 +0,0 @@
-#========================================================================
-#
-# Goo library Makefile
-#
-# Copyright 1996-2003 Glyph & Cog, LLC
-#
-#========================================================================
-
-SHELL = /bin/sh
-
-srcdir = @srcdir@
-VPATH = @srcdir@
-
-CFLAGS = @CFLAGS@ @DEFS@ -I.. -I$(srcdir)/.. -I$(srcdir)
-CXXFLAGS = @CXXFLAGS@ @DEFS@ -I.. -I$(srcdir)/.. -I$(srcdir)
-
-CC = @CC@
-CXX = @CXX@
-AR = @AR@
-RANLIB = @RANLIB@
-
-LIBPREFIX = @LIBPREFIX@
-
-#------------------------------------------------------------------------
-
-.SUFFIXES: .cc
-
-.cc.o:
-	$(CXX) $(CXXFLAGS) -c $<
-
-#------------------------------------------------------------------------
-
-CXX_SRC = \
-	$(srcdir)/GHash.cc \
-	$(srcdir)/GList.cc \
-	$(srcdir)/GString.cc \
-	$(srcdir)/gmem.cc \
-	$(srcdir)/gmempp.cc \
-	$(srcdir)/gfile.cc \
-	$(srcdir)/FixedPoint.cc
-
-C_SRC = \
-	$(srcdir)/parseargs.c
-
-#------------------------------------------------------------------------
-
-all: $(LIBPREFIX)Goo.a
-
-#------------------------------------------------------------------------
-
-GOO_CXX_OBJS = GHash.o GList.o GString.o gmem.o gmempp.o gfile.o FixedPoint.o
-GOO_C_OBJS = parseargs.o
-GOO_OBJS = $(GOO_CXX_OBJS) $(GOO_C_OBJS)
-
-$(LIBPREFIX)Goo.a: $(GOO_OBJS)
-	rm -f $(LIBPREFIX)Goo.a
-	$(AR) $(LIBPREFIX)Goo.a $(GOO_OBJS)
-	$(RANLIB) $(LIBPREFIX)Goo.a
-
-#------------------------------------------------------------------------
-
-clean:
-	rm -f $(GOO_OBJS) $(LIBPREFIX)Goo.a
-
-#------------------------------------------------------------------------
-
-depend:
-	$(CXX) $(CXXFLAGS) -MM $(CXX_SRC) >Makefile.dep
-	$(CC) $(CFLAGS) -MM $(C_SRC) >>Makefile.dep
-
--include Makefile.dep

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/goo/gfile.cc
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/goo/gfile.cc	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/goo/gfile.cc	2017-11-01 18:15:56 UTC (rev 780)
@@ -17,9 +17,7 @@
 #  include <time.h>
 #  include <direct.h>
 #else
-#  if defined(MACOS)
-#    include <sys/stat.h>
-#  elif !defined(ACORN)
+#  if !defined(ACORN)
 #    include <sys/types.h>
 #    include <sys/stat.h>
 #    include <fcntl.h>
@@ -27,7 +25,7 @@
 #  include <time.h>
 #  include <limits.h>
 #  include <string.h>
-#  if !defined(VMS) && !defined(ACORN) && !defined(MACOS)
+#  if !defined(VMS) && !defined(ACORN)
 #    include <pwd.h>
 #  endif
 #  if defined(VMS) && (__DECCXX_VER < 50200000)
@@ -34,6 +32,7 @@
 #    include <unixlib.h>
 #  endif
 #endif // _WIN32
+#include "gmempp.h"
 #include "GString.h"
 #include "gfile.h"
 
@@ -69,10 +68,6 @@
   //---------- RISCOS ----------
   return new GString("@");
 
-#elif defined(MACOS)
-  //---------- MacOS ----------
-  return new GString(":");
-
 #else
   //---------- Unix ----------
   char *s;
@@ -104,8 +99,6 @@
   if (GetCurrentDirectoryA(sizeof(buf), buf))
 #elif defined(ACORN)
   if (strcpy(buf, "@"))
-#elif defined(MACOS)
-  if (strcpy(buf, ":"))
 #else
   if (getcwd(buf, sizeof(buf)))
 #endif
@@ -186,23 +179,6 @@
   }
   return path;
 
-#elif defined(MACOS)
-  //---------- MacOS ----------
-  char *p;
-  int i;
-
-  path->append(":");
-  i = path->getLength();
-  path->append(fileName);
-  for (p = path->getCString() + i; *p; ++p) {
-    if (*p == '/') {
-      *p = ':';
-    } else if (*p == '.') {
-      *p = ':';
-    }
-  }
-  return path;
-
 #elif defined(__EMX__)
   //---------- OS/2+EMX ----------
   int i;
@@ -310,14 +286,6 @@
     return new GString(fileName, p - fileName);
   return new GString();
 
-#elif defined(MACOS)
-  //---------- MacOS ----------
-  char *p;
-
-  if ((p = strrchr(fileName, ':')))
-    return new GString(fileName, p - fileName);
-  return new GString();
-
 #else
   //---------- Unix ----------
   char *p;
@@ -342,10 +310,6 @@
   //---------- RISCOS ----------
   return path[0] == '$';
 
-#elif defined(MACOS)
-  //---------- MacOS ----------
-  return path[0] != ':';
-
 #else
   //---------- Unix ----------
   return path[0] == '/';
@@ -383,11 +347,6 @@
   path->insert(0, '@');
   return path;
 
-#elif defined(MACOS)
-  //---------- MacOS ----------
-  path->del(0, 1);
-  return path;
-
 #else
   //---------- Unix and OS/2+EMX ----------
   struct passwd *pw;
@@ -453,25 +412,29 @@
 		   const char *mode, const char *ext) {
 #if defined(_WIN32)
   //---------- Win32 ----------
-  char *tempDir;
+  char tempPath[MAX_PATH + 1];
   GString *s, *s2;
   FILE *f2;
+  DWORD n;
   int t, i;
 
   // this has the standard race condition problem, but I haven't found
   // a better way to generate temp file names with extensions on
   // Windows
-  if ((tempDir = getenv("TEMP"))) {
-    s = new GString(tempDir);
-    s->append('\\');
+  n = GetTempPathA(sizeof(tempPath), tempPath);
+  if (n > 0 && n <= sizeof(tempPath)) {
+    s = new GString(tempPath);
+    if (tempPath[n-1] != '\\') {
+      s->append('\\');
+    }
   } else {
-    s = new GString();
+    s = new GString(".\\");
   }
-  s->appendf("x_{0:d}_{1:d}_",
+  s->appendf("xpdf_{0:d}_{1:d}_",
 	     (int)GetCurrentProcessId(), (int)GetCurrentThreadId());
   t = (int)time(NULL);
   for (i = 0; i < 1000; ++i) {
-    s2 = s->copy()->appendf("{0:d}", t + i);
+    s2 = GString::format("{0:t}{1:d}", s, t + i);
     if (ext) {
       s2->append(ext);
     }
@@ -491,7 +454,7 @@
   }
   delete s;
   return gFalse;
-#elif defined(VMS) || defined(__EMX__) || defined(ACORN) || defined(MACOS)
+#elif defined(VMS) || defined(__EMX__) || defined(ACORN)
   //---------- non-Unix ----------
   char *s;
 
@@ -730,152 +693,3 @@
   return ftell(f);
 #endif
 }
-
-//------------------------------------------------------------------------
-// GDir and GDirEntry
-//------------------------------------------------------------------------
-
-GDirEntry::GDirEntry(char *dirPath, char *nameA, GBool doStat) {
-#ifdef VMS
-  char *p;
-#elif defined(_WIN32)
-  int fa;
-  GString *s;
-#elif defined(ACORN)
-#else
-  struct stat st;
-  GString *s;
-#endif
-
-  name = new GString(nameA);
-  dir = gFalse;
-  if (doStat) {
-#ifdef VMS
-    if (!strcmp(nameA, "-") ||
-	((p = strrchr(nameA, '.')) && !strncmp(p, ".DIR;", 5)))
-      dir = gTrue;
-#elif defined(ACORN)
-#else
-    s = new GString(dirPath);
-    appendToPath(s, nameA);
-#ifdef _WIN32
-    fa = GetFileAttributesA(s->getCString());
-    dir = (fa != 0xFFFFFFFF && (fa & FILE_ATTRIBUTE_DIRECTORY));
-#else
-    if (stat(s->getCString(), &st) == 0)
-      dir = S_ISDIR(st.st_mode);
-#endif
-    delete s;
-#endif
-  }
-}
-
-GDirEntry::~GDirEntry() {
-  delete name;
-}
-
-GDir::GDir(char *name, GBool doStatA) {
-  path = new GString(name);
-  doStat = doStatA;
-#if defined(_WIN32)
-  GString *tmp;
-
-  tmp = path->copy();
-  tmp->append("/*.*");
-  hnd = FindFirstFileA(tmp->getCString(), &ffd);
-  delete tmp;
-#elif defined(ACORN)
-#elif defined(MACOS)
-#elif defined(ANDROID)
-#else
-  dir = opendir(name);
-#ifdef VMS
-  needParent = strchr(name, '[') != NULL;
-#endif
-#endif
-}
-
-GDir::~GDir() {
-  delete path;
-#if defined(_WIN32)
-  if (hnd) {
-    FindClose(hnd);
-    hnd = NULL;
-  }
-#elif defined(ACORN)
-#elif defined(MACOS)
-#elif defined(ANDROID)
-#else
-  if (dir)
-    closedir(dir);
-#endif
-}
-
-GDirEntry *GDir::getNextEntry() {
-  GDirEntry *e;
-
-#if defined(_WIN32)
-  if (hnd) {
-    e = new GDirEntry(path->getCString(), ffd.cFileName, doStat);
-    if (hnd  && !FindNextFileA(hnd, &ffd)) {
-      FindClose(hnd);
-      hnd = NULL;
-    }
-  } else {
-    e = NULL;
-  }
-#elif defined(ACORN)
-#elif defined(MACOS)
-#elif defined(ANDROID)
-#elif defined(VMS)
-  struct dirent *ent;
-  e = NULL;
-  if (dir) {
-    if (needParent) {
-      e = new GDirEntry(path->getCString(), "-", doStat);
-      needParent = gFalse;
-      return e;
-    }
-    ent = readdir(dir);
-    if (ent) {
-      e = new GDirEntry(path->getCString(), ent->d_name, doStat);
-    }
-  }
-#else
-  struct dirent *ent;
-  e = NULL;
-  if (dir) {
-    ent = (struct dirent *)readdir(dir);
-    if (ent && !strcmp(ent->d_name, ".")) {
-      ent = (struct dirent *)readdir(dir);
-    }
-    if (ent) {
-      e = new GDirEntry(path->getCString(), ent->d_name, doStat);
-    }
-  }
-#endif
-
-  return e;
-}
-
-void GDir::rewind() {
-#ifdef _WIN32
-  GString *tmp;
-
-  if (hnd)
-    FindClose(hnd);
-  tmp = path->copy();
-  tmp->append("/*.*");
-  hnd = FindFirstFileA(tmp->getCString(), &ffd);
-  delete tmp;
-#elif defined(ACORN)
-#elif defined(MACOS)
-#elif defined(ANDROID)
-#else
-  if (dir)
-    rewinddir(dir);
-#ifdef VMS
-  needParent = strchr(path->getCString(), '[') != NULL;
-#endif
-#endif
-}

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/goo/gfile.h
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/goo/gfile.h	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/goo/gfile.h	2017-11-01 18:15:56 UTC (rev 780)
@@ -22,30 +22,10 @@
 #    include <windows.h>
 #  endif
 #elif defined(ACORN)
-#elif defined(MACOS)
-#  include <ctime.h>
 #elif defined(ANDROID)
 #else
 #  include <unistd.h>
 #  include <sys/types.h>
-#  ifdef VMS
-#    include "vms_dirent.h"
-#  elif HAVE_DIRENT_H
-#    include <dirent.h>
-#    define NAMLEN(d) strlen((d)->d_name)
-#  else
-#    define dirent direct
-#    define NAMLEN(d) (d)->d_namlen
-#    if HAVE_SYS_NDIR_H
-#      include <sys/ndir.h>
-#    endif
-#    if HAVE_SYS_DIR_H
-#      include <sys/dir.h>
-#    endif
-#    if HAVE_NDIR_H
-#      include <ndir.h>
-#    endif
-#  endif
 #endif
 #include "gtypes.h"
 
@@ -132,48 +112,4 @@
 // Like ftell, but returns a 64-bit file offset if available.
 extern GFileOffset gftell(FILE *f);
 
-//------------------------------------------------------------------------
-// GDir and GDirEntry
-//------------------------------------------------------------------------
-
-class GDirEntry {
-public:
-
-  GDirEntry(char *dirPath, char *nameA, GBool doStat);
-  ~GDirEntry();
-  GString *getName() { return name; }
-  GBool isDir() { return dir; }
-
-private:
-
-  GString *name;		// dir/file name
-  GBool dir;			// is it a directory?
-};
-
-class GDir {
-public:
-
-  GDir(char *name, GBool doStatA = gTrue);
-  ~GDir();
-  GDirEntry *getNextEntry();
-  void rewind();
-
-private:
-
-  GString *path;		// directory path
-  GBool doStat;			// call stat() for each entry?
-#if defined(_WIN32)
-  WIN32_FIND_DATAA ffd;
-  HANDLE hnd;
-#elif defined(ACORN)
-#elif defined(MACOS)
-#elif defined(ANDROID)
-#else
-  DIR *dir;			// the DIR structure from opendir()
-#ifdef VMS
-  GBool needParent;		// need to return an entry for [-]
 #endif
-#endif
-};
-
-#endif

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/goo/gmem.cc
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/goo/gmem.cc	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/goo/gmem.cc	2017-11-01 18:15:56 UTC (rev 780)
@@ -12,6 +12,9 @@
 #include <stddef.h>
 #include <string.h>
 #include <limits.h>
+#if MULTITHREADED && defined(_WIN32)
+#  include <windows.h>
+#endif
 #include "gmem.h"
 
 #ifdef DEBUG_MEM
@@ -28,7 +31,7 @@
 
 #define gMemMagic 0xabcd9999
 
-#if gmemTrlSize==8
+#if ULONG_MAX > 0xffffffffL
 #define gMemDeadVal 0xdeadbeefdeadbeefUL
 #else
 #define gMemDeadVal 0xdeadbeefUL
@@ -46,10 +49,36 @@
 static int gMemInUse = 0;
 static int gMaxMemInUse = 0;
 
+#if MULTITHREADED
+#  ifdef _WIN32
+     static CRITICAL_SECTION gMemMutex;
+     static INIT_ONCE gMemMutexInitStruct = INIT_ONCE_STATIC_INIT;
+     static BOOL CALLBACK gMemMutexInitFunc(PINIT_ONCE initOnce, PVOID param,
+					    PVOID *context) {
+       InitializeCriticalSection(&gMemMutex);
+       return TRUE;
+     }
+#    define gMemInitMutex InitOnceExecuteOnce(&gMemMutexInitStruct, \
+                                              &gMemMutexInitFunc, NULL, NULL)
+#    define gMemLock EnterCriticalSection(&gMemMutex);
+#    define gMemUnlock LeaveCriticalSection(&gMemMutex);
+#  else
+#    include <pthread.h>
+     static pthread_mutex_t gMemMutex = PTHREAD_MUTEX_INITIALIZER;
+#    define gMemInitMutex
+#    define gMemLock pthread_mutex_lock(&gMemMutex)
+#    define gMemUnlock pthread_mutex_unlock(&gMemMutex)
+#  endif
+#else
+#  define gMemInitMutex
+#  define gMemLock
+#  define gMemUnlock
+#endif
+
 #endif /* DEBUG_MEM */
 
-void *gmalloc(int size) GMEM_EXCEP {
 #ifdef DEBUG_MEM
+void *gmalloc(int size, int ignore) GMEM_EXCEP {
   int size1;
   char *mem;
   GMemHdr *hdr;
@@ -56,6 +85,7 @@
   void *data;
   unsigned long *trl, *p;
 
+  gMemInitMutex;
   if (size < 0) {
     gMemError("Invalid memory allocation size");
   }
@@ -71,7 +101,12 @@
   trl = (unsigned long *)(mem + gMemHdrSize + size1);
   hdr->magic = gMemMagic;
   hdr->size = size;
-  hdr->index = gMemIndex++;
+  if (ignore) {
+    hdr->index = -1;
+  } else {
+    hdr->index = gMemIndex++;
+  }
+  gMemLock;
   if (gMemTail) {
     gMemTail->next = hdr;
     hdr->prev = gMemTail;
@@ -86,11 +121,14 @@
   if (gMemInUse > gMaxMemInUse) {
     gMaxMemInUse = gMemInUse;
   }
+  gMemUnlock;
   for (p = (unsigned long *)data; p <= trl; ++p) {
     *p = gMemDeadVal;
   }
   return data;
+}
 #else
+void *gmalloc(int size) GMEM_EXCEP {
   void *p;
 
   if (size < 0) {
@@ -103,8 +141,8 @@
     gMemError("Out of memory");
   }
   return p;
+}
 #endif
-}
 
 void *grealloc(void *p, int size) GMEM_EXCEP {
 #ifdef DEBUG_MEM
@@ -192,6 +230,7 @@
 
   if (p) {
     hdr = (GMemHdr *)((char *)p - gMemHdrSize);
+    gMemLock;
     if (hdr->magic == gMemMagic &&
 	((hdr->prev == NULL) == (hdr == gMemHead)) &&
 	((hdr->next == NULL) == (hdr == gMemTail))) {
@@ -207,6 +246,7 @@
       }
       --gMemAlloc;
       gMemInUse -= hdr->size;
+      gMemUnlock;
       size = gMemDataSize(hdr->size);
       trl = (unsigned long *)((char *)hdr + gMemHdrSize + size);
       if (*trl != gMemDeadVal) {
@@ -218,6 +258,7 @@
       }
       free(hdr);
     } else {
+      gMemUnlock;
       fprintf(stderr, "Attempted to free bad address %p\n", p);
     }
   }
@@ -240,17 +281,25 @@
 #ifdef DEBUG_MEM
 void gMemReport(FILE *f) {
   GMemHdr *p;
+  int left;
 
   fprintf(f, "%d memory allocations in all\n", gMemIndex);
   fprintf(f, "maximum memory in use: %d bytes\n", gMaxMemInUse);
+  left = 0;
   if (gMemAlloc > 0) {
-    fprintf(f, "%d memory blocks left allocated:\n", gMemAlloc);
-    fprintf(f, " index     size\n");
-    fprintf(f, "-------- --------\n");
     for (p = gMemHead; p; p = p->next) {
-      fprintf(f, "%8d %8d\n", p->index, p->size);
+      if (p->index >= 0) {
+	if (!left) {
+	  fprintf(f, "%d memory blocks left allocated:\n", gMemAlloc);
+	  fprintf(f, " index     size\n");
+	  fprintf(f, "-------- --------\n");
+	  left = 1;
+	}
+	fprintf(f, "%8d %8d\n", p->index, p->size);
+      }
     }
-  } else {
+  }
+  if (!left) {
     fprintf(f, "No memory blocks left allocated\n");
   }
 }

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/goo/gmem.h
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/goo/gmem.h	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/goo/gmem.h	2017-11-01 18:15:56 UTC (rev 780)
@@ -36,7 +36,11 @@
  * Same as malloc, but prints error message and exits if malloc()
  * returns NULL.
  */
+#ifdef DEBUG_MEM
+extern void *gmalloc(int size, int ignore = 0) GMEM_EXCEP;
+#else
 extern void *gmalloc(int size) GMEM_EXCEP;
+#endif
 
 /*
  * Same as realloc, but prints error message and exits if realloc()

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/goo/gmempp.cc
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/goo/gmempp.cc	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/goo/gmempp.cc	2017-11-01 18:15:56 UTC (rev 780)
@@ -10,23 +10,42 @@
 
 #include <aconf.h>
 #include "gmem.h"
+// NB: do not include gmempp.h here.
 
 #ifdef DEBUG_MEM
 
 void *operator new(size_t size) {
-  return gmalloc((int)size);
+  return gmalloc((int)size, 1);
 }
 
+void *operator new(size_t size, int dummy) {
+  return gmalloc((int)size, 0);
+}
+
 void *operator new[](size_t size) {
-  return gmalloc((int)size);
+  return gmalloc((int)size, 1);
 }
 
+void *operator new[](size_t size, int dummy) {
+  return gmalloc((int)size, 0);
+}
+
 void operator delete(void *p) {
   gfree(p);
 }
 
+// This is only called if a constructor throws an exception.
+void operator delete(void *p, int dummy) {
+  gfree(p);
+}
+
 void operator delete[](void *p) {
   gfree(p);
 }
 
+// This is only called if a constructor throws an exception.
+void operator delete[](void *p, int dummy) {
+  gfree(p);
+}
+
 #endif

Added: branches/stable/source/src/libs/xpdf/xpdf-src/goo/gmempp.h
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/goo/gmempp.h	                        (rev 0)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/goo/gmempp.h	2017-11-01 18:15:56 UTC (rev 780)
@@ -0,0 +1,48 @@
+//========================================================================
+//
+// gmempp.h
+//
+// Redefine the new and delete operators to call the debugging malloc.
+//
+// This is a hack: some libraries (Qt) allocate global objects and
+// never free them, so this file #define's new to have an argument, so
+// that we can differentiate our new calls from external library new
+// calls.  Calls from external libraries will not be counted when
+// un-freed memory is listed.  There's no guarantee that this will
+// work in all cases: if some external library also defines a new
+// operator that takes the same extra argument, things will break
+// horribly.
+//
+// This entire .h file is wrapped in '#ifdef DEBUG_MEM'.  I.e., if you
+// don't define DEBUG_MEM, this hack goes away and can't cause any
+// problems.  Do not define DEBUG_MEM in production code.
+//
+// To use this .h file, it must be #included *after* all system
+// includes.  Calls to new in any modules that do not include this .h
+// file will not be counted as un-freed memory.
+//
+//========================================================================
+
+#ifndef GMEMPP_H
+#define GMEMPP_H
+
+#ifdef DEBUG_MEM
+
+#include <stdlib.h>
+
+extern void *operator new(size_t size, int dummy);
+extern void *operator new[](size_t size, int dummy);
+
+// These have to be defined (and declared) to avoid a compiler warning
+// with Visual Studio.
+extern void operator delete(void *p, int dummy);
+extern void operator delete[](void *p, int dummy);
+
+// This transforms 'new Foo(...)' into 'new (1) Foo(...)', which
+// forces a call to the operator new variant with the 'int dummy' arg.
+#define debug_new new (1)
+#define new debug_new
+
+#endif // DEBUG_MEM
+
+#endif // GMEMPP_H


Property changes on: branches/stable/source/src/libs/xpdf/xpdf-src/goo/gmempp.h
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: branches/stable/source/src/libs/xpdf/xpdf-src/goo/parseargs.c
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/goo/parseargs.c	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/goo/parseargs.c	2017-11-01 18:15:56 UTC (rev 780)
@@ -26,14 +26,19 @@
   while (i < *argc) {
     if (!strcmp(argv[i], "--")) {
       --*argc;
-      for (j = i; j < *argc; ++j)
+      for (j = i; j < *argc; ++j) {
 	argv[j] = argv[j+1];
+      }
       break;
     } else if ((arg = findArg(args, argv[i]))) {
-      if (!grabArg(arg, i, argc, argv))
+      if (!grabArg(arg, i, argc, argv)) {
 	ok = gFalse;
+      }
+    } else if (argv[i][0] == '-') {
+      ok = gFalse;
+      break;
     } else {
-      ++i;
+      break;
     }
   }
   return ok;
@@ -65,7 +70,7 @@
       break;
     case argFP:
     case argFPDummy:
-      typ = " <fp>";
+      typ = " <number>";
       break;
     case argString:
     case argStringDummy:

Deleted: branches/stable/source/src/libs/xpdf/xpdf-src/ms_make.bat
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/ms_make.bat	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/ms_make.bat	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,134 +0,0 @@
-set CC=cl
-set CXX=cl
-set FT2DIR=..\freetype-2.5.3
-rem *** Set PNGDIR and ZLIBDIR to build pdftohtml
-rem set PNGDIR=..\libpng-1.5.12
-rem set ZLIBDIR=..\zlib-1.2.7
-set CFLAGS=/I.. /I..\goo /I..\fofi /I..\splash /O2 /nologo /I%FT2DIR%\include
-set CXXFLAGS=%CFLAGS% /TP
-set LIBPROG=lib
-set LINKFLAGS=/MT /nologo
-
-copy aconf-win32.h aconf.h
-
-cd goo
-%CXX% %CXXFLAGS% /c GHash.cc
-%CXX% %CXXFLAGS% /c GList.cc
-%CXX% %CXXFLAGS% /c GString.cc
-%CXX% %CXXFLAGS% /c gmem.cc
-%CXX% %CXXFLAGS% /c gmempp.cc
-%CXX% %CXXFLAGS% /c gfile.cc
-%CC% %CFLAGS% /c parseargs.c
-%LIBPROG% /nologo /out:Goo.lib GHash.obj GList.obj GString.obj gmempp.obj gfile.obj gmem.obj parseargs.obj
-
-cd ..\fofi
-%CXX% %CXXFLAGS% /c FoFiBase.cc
-%CXX% %CXXFLAGS% /c FoFiEncodings.cc
-%CXX% %CXXFLAGS% /c FoFiIdentifier.cc
-%CXX% %CXXFLAGS% /c FoFiTrueType.cc
-%CXX% %CXXFLAGS% /c FoFiType1.cc
-%CXX% %CXXFLAGS% /c FoFiType1C.cc
-%LIBPROG% /nologo /out:fofi.lib FoFiBase.obj FoFiEncodings.obj FoFiIdentifier.obj FoFiTrueType.obj FoFiType1.obj FoFiType1C.obj
-
-cd ..\splash
-%CXX% %CXXFLAGS% /c Splash.cc
-%CXX% %CXXFLAGS% /c SplashBitmap.cc
-%CXX% %CXXFLAGS% /c SplashClip.cc
-%CXX% %CXXFLAGS% /c SplashFTFont.cc
-%CXX% %CXXFLAGS% /c SplashFTFontEngine.cc
-%CXX% %CXXFLAGS% /c SplashFTFontFile.cc
-%CXX% %CXXFLAGS% /c SplashFont.cc
-%CXX% %CXXFLAGS% /c SplashFontEngine.cc
-%CXX% %CXXFLAGS% /c SplashFontFile.cc
-%CXX% %CXXFLAGS% /c SplashFontFileID.cc
-%CXX% %CXXFLAGS% /c SplashPath.cc
-%CXX% %CXXFLAGS% /c SplashPattern.cc
-%CXX% %CXXFLAGS% /c SplashScreen.cc
-%CXX% %CXXFLAGS% /c SplashState.cc
-%CXX% %CXXFLAGS% /c SplashXPath.cc
-%CXX% %CXXFLAGS% /c SplashXPathScanner.cc
-%LIBPROG% /nologo /out:splash.lib Splash.obj SplashBitmap.obj SplashClip.obj SplashFTFont.obj SplashFTFontEngine.obj SplashFTFontFile.obj SplashFont.obj SplashFontEngine.obj SplashFontFile.obj SplashFontFileID.obj SplashPath.obj SplashPattern.obj SplashScreen.obj SplashState.obj SplashXPath.obj SplashXPathScanner.obj
-
-cd ..\xpdf
-%CXX% %CXXFLAGS% /c AcroForm.cc
-%CXX% %CXXFLAGS% /c Annot.cc
-%CXX% %CXXFLAGS% /c Array.cc
-%CXX% %CXXFLAGS% /c BuiltinFont.cc
-%CXX% %CXXFLAGS% /c BuiltinFontTables.cc
-%CXX% %CXXFLAGS% /c CMap.cc
-%CXX% %CXXFLAGS% /c Catalog.cc
-%CXX% %CXXFLAGS% /c CharCodeToUnicode.cc
-%CXX% %CXXFLAGS% /c Decrypt.cc
-%CXX% %CXXFLAGS% /c Dict.cc
-%CXX% %CXXFLAGS% /c Error.cc
-%CXX% %CXXFLAGS% /c FontEncodingTables.cc
-%CXX% %CXXFLAGS% /c Form.cc
-%CXX% %CXXFLAGS% /c Function.cc
-%CXX% %CXXFLAGS% /c Gfx.cc
-%CXX% %CXXFLAGS% /c GfxFont.cc
-%CXX% %CXXFLAGS% /c GfxState.cc
-%CXX% %CXXFLAGS% /c GlobalParams.cc
-%CXX% %CXXFLAGS% /c ImageOutputDev.cc
-%CXX% %CXXFLAGS% /c JArithmeticDecoder.cc
-%CXX% %CXXFLAGS% /c JBIG2Stream.cc
-%CXX% %CXXFLAGS% /c JPXStream.cc
-%CXX% %CXXFLAGS% /c Lexer.cc
-%CXX% %CXXFLAGS% /c Link.cc
-%CXX% %CXXFLAGS% /c NameToCharCode.cc
-%CXX% %CXXFLAGS% /c Object.cc
-%CXX% %CXXFLAGS% /c OptionalContent.cc
-%CXX% %CXXFLAGS% /c Outline.cc
-%CXX% %CXXFLAGS% /c OutputDev.cc
-%CXX% %CXXFLAGS% /c PDFDoc.cc
-%CXX% %CXXFLAGS% /c PDFDocEncoding.cc
-%CXX% %CXXFLAGS% /c PSOutputDev.cc
-%CXX% %CXXFLAGS% /c PSTokenizer.cc
-%CXX% %CXXFLAGS% /c Page.cc
-%CXX% %CXXFLAGS% /c Parser.cc
-%CXX% %CXXFLAGS% /c PreScanOutputDev.cc
-%CXX% %CXXFLAGS% /c SecurityHandler.cc
-%CXX% %CXXFLAGS% /c SplashOutputDev.cc
-%CXX% %CXXFLAGS% /c Stream.cc
-%CXX% %CXXFLAGS% /c TextOutputDev.cc
-%CXX% %CXXFLAGS% /c TextString.cc
-%CXX% %CXXFLAGS% /c UnicodeMap.cc
-%CXX% %CXXFLAGS% /c UnicodeTypeTable.cc
-%CXX% %CXXFLAGS% /c XFAForm.cc
-%CXX% %CXXFLAGS% /c XRef.cc
-%CXX% %CXXFLAGS% /c Zoox.cc
-%CXX% %CXXFLAGS% /c pdftops.cc
-%CXX% %CXXFLAGS% /c pdftotext.cc
-%CXX% %CXXFLAGS% /c pdftoppm.cc
-%CXX% %CXXFLAGS% /c pdfinfo.cc
-%CXX% %CXXFLAGS% /c pdffonts.cc
-%CXX% %CXXFLAGS% /c pdfdetach.cc
-%CXX% %CXXFLAGS% /c pdfimages.cc
-
-%CXX% %LINKFLAGS% /Fepdftops.exe AcroForm.obj Annot.obj Array.obj BuiltinFont.obj BuiltinFontTables.obj Catalog.obj CharCodeToUnicode.obj CMap.obj Decrypt.obj Dict.obj Error.obj FontEncodingTables.obj Form.obj Function.obj Gfx.obj GfxFont.obj GfxState.obj GlobalParams.obj JArithmeticDecoder.obj JBIG2Stream.obj JPXStream.obj Lexer.obj Link.obj NameToCharCode.obj Object.obj OptionalContent.obj Outline.obj OutputDev.obj Page.obj Parser.obj PDFDoc.obj PDFDocEncoding.obj PSOutputDev.obj PSTokenizer.obj PreScanOutputDev.obj SecurityHandler.obj SplashOutputDev.obj Stream.obj TextString.obj UnicodeMap.obj XFAForm.obj XRef.obj Zoox.obj pdftops.obj ..\splash\splash.lib ..\fofi\fofi.lib ..\goo\Goo.lib %FT2DIR%\freetype2.lib shell32.lib user32.lib gdi32.lib advapi32.lib
-
-%CXX% %LINKFLAGS% /Fepdftotext.exe AcroForm.obj Annot.obj Array.obj BuiltinFont.obj BuiltinFontTables.obj Catalog.obj CharCodeToUnicode.obj CMap.obj Decrypt.obj Dict.obj Error.obj FontEncodingTables.obj Form.obj Function.obj Gfx.obj GfxFont.obj GfxState.obj GlobalParams.obj JArithmeticDecoder.obj JBIG2Stream.obj JPXStream.obj Lexer.obj Link.obj NameToCharCode.obj Object.obj OptionalContent.obj Outline.obj OutputDev.obj Page.obj Parser.obj PDFDoc.obj PDFDocEncoding.obj PSTokenizer.obj SecurityHandler.obj Stream.obj TextOutputDev.obj TextString.obj UnicodeMap.obj UnicodeTypeTable.obj XFAForm.obj XRef.obj Zoox.obj pdftotext.obj ..\fofi\fofi.lib ..\goo\Goo.lib shell32.lib user32.lib gdi32.lib advapi32.lib
-
-%CXX% %LINKFLAGS% /Fepdftoppm.exe AcroForm.obj Annot.obj Array.obj BuiltinFont.obj BuiltinFontTables.obj Catalog.obj CharCodeToUnicode.obj CMap.obj Decrypt.obj Dict.obj Error.obj FontEncodingTables.obj Form.obj Function.obj Gfx.obj GfxFont.obj GfxState.obj GlobalParams.obj JArithmeticDecoder.obj JBIG2Stream.obj JPXStream.obj Lexer.obj Link.obj NameToCharCode.obj Object.obj OptionalContent.obj Outline.obj OutputDev.obj Page.obj Parser.obj PDFDoc.obj PDFDocEncoding.obj PSTokenizer.obj SecurityHandler.obj SplashOutputDev.obj Stream.obj TextString.obj UnicodeMap.obj UnicodeTypeTable.obj XFAForm.obj XRef.obj Zoox.obj pdftoppm.obj ..\splash\splash.lib ..\fofi\fofi.lib ..\goo\Goo.lib %FT2DIR%\freetype2.lib shell32.lib user32.lib gdi32.lib advapi32.lib
-
-%CXX% %LINKFLAGS% /Fepdfinfo.exe AcroForm.obj Annot.obj Array.obj BuiltinFont.obj BuiltinFontTables.obj Catalog.obj CharCodeToUnicode.obj CMap.obj Decrypt.obj Dict.obj Error.obj FontEncodingTables.obj Form.obj Function.obj Gfx.obj GfxFont.obj GfxState.obj GlobalParams.obj JArithmeticDecoder.obj JBIG2Stream.obj JPXStream.obj Lexer.obj Link.obj NameToCharCode.obj Object.obj OptionalContent.obj Outline.obj OutputDev.obj Page.obj Parser.obj PDFDoc.obj PDFDocEncoding.obj PSTokenizer.obj SecurityHandler.obj Stream.obj TextString.obj UnicodeMap.obj XFAForm.obj XRef.obj Zoox.obj pdfinfo.obj ..\fofi\fofi.lib ..\goo\Goo.lib shell32.lib user32.lib gdi32.lib advapi32.lib
-
-%CXX% %LINKFLAGS% /Fepdffonts.exe AcroForm.obj Annot.obj Array.obj BuiltinFont.obj BuiltinFontTables.obj Catalog.obj CharCodeToUnicode.obj CMap.obj Decrypt.obj Dict.obj Error.obj FontEncodingTables.obj Form.obj Function.obj Gfx.obj GfxFont.obj GfxState.obj GlobalParams.obj JArithmeticDecoder.obj JBIG2Stream.obj JPXStream.obj Lexer.obj Link.obj NameToCharCode.obj Object.obj OptionalContent.obj Outline.obj OutputDev.obj Page.obj Parser.obj PDFDoc.obj PDFDocEncoding.obj PSTokenizer.obj SecurityHandler.obj Stream.obj TextString.obj UnicodeMap.obj XFAForm.obj XRef.obj Zoox.obj pdffonts.obj ..\fofi\fofi.lib ..\goo\Goo.lib shell32.lib user32.lib gdi32.lib advapi32.lib
-
-%CXX% %LINKFLAGS% /Fepdfdetach.exe AcroForm.obj Annot.obj Array.obj BuiltinFont.obj BuiltinFontTables.obj Catalog.obj CharCodeToUnicode.obj CMap.obj Decrypt.obj Dict.obj Error.obj FontEncodingTables.obj Form.obj Function.obj Gfx.obj GfxFont.obj GfxState.obj GlobalParams.obj JArithmeticDecoder.obj JBIG2Stream.obj JPXStream.obj Lexer.obj Link.obj NameToCharCode.obj Object.obj OptionalContent.obj Outline.obj OutputDev.obj Page.obj Parser.obj PDFDoc.obj PDFDocEncoding.obj PSTokenizer.obj SecurityHandler.obj Stream.obj TextString.obj UnicodeMap.obj XFAForm.obj XRef.obj Zoox.obj pdfdetach.obj ..\fofi\fofi.lib ..\goo\Goo.lib shell32.lib user32.lib gdi32.lib advapi32.lib
-
-%CXX% %LINKFLAGS% /Fepdfimages.exe AcroForm.obj Annot.obj Array.obj BuiltinFont.obj BuiltinFontTables.obj Catalog.obj CharCodeToUnicode.obj CMap.obj Decrypt.obj Dict.obj Error.obj FontEncodingTables.obj Form.obj Function.obj Gfx.obj GfxFont.obj GfxState.obj GlobalParams.obj ImageOutputDev.obj JArithmeticDecoder.obj JBIG2Stream.obj JPXStream.obj Lexer.obj Link.obj NameToCharCode.obj Object.obj OptionalContent.obj Outline.obj OutputDev.obj Page.obj Parser.obj PDFDoc.obj PDFDocEncoding.obj PSTokenizer.obj SecurityHandler.obj Stream.obj TextString.obj UnicodeMap.obj XFAForm.obj XRef.obj Zoox.obj pdfimages.obj ..\fofi\fofi.lib ..\goo\Goo.lib shell32.lib user32.lib gdi32.lib advapi32.lib
-
-if x%PNGDIR% == x goto noHTML
-if x%ZLIBDIR% == x goto noHTML
-
-%CXX% %CXXFLAGS% /I%PNGDIR% /I%ZLIBDIR% /c pdftopng.cc
-%CXX% %LINKFLAGS% /Fepdftopng.exe AcroForm.obj Annot.obj Array.obj BuiltinFont.obj BuiltinFontTables.obj Catalog.obj CharCodeToUnicode.obj CMap.obj Decrypt.obj Dict.obj Error.obj FontEncodingTables.obj Form.obj Function.obj Gfx.obj GfxFont.obj GfxState.obj GlobalParams.obj JArithmeticDecoder.obj JBIG2Stream.obj JPXStream.obj Lexer.obj Link.obj NameToCharCode.obj Object.obj OptionalContent.obj Outline.obj OutputDev.obj Page.obj Parser.obj PDFDoc.obj PDFDocEncoding.obj PSTokenizer.obj SecurityHandler.obj SplashOutputDev.obj Stream.obj TextString.obj UnicodeMap.obj UnicodeTypeTable.obj XFAForm.obj XRef.obj Zoox.obj pdftopng.obj ..\splash\splash.lib ..\fofi\fofi.lib ..\goo\Goo.lib %FT2DIR%\freetype2.lib %PNGDIR%\libpng.lib %ZLIBDIR%\zlib.lib shell32.lib user32.lib gdi32.lib advapi32.lib
-
-echo "building pdftohtml"
-%CXX% %CXXFLAGS% /I%PNGDIR% /I%ZLIBDIR% /c HTMLGen.cc
-%CXX% %CXXFLAGS% /I%PNGDIR% /I%ZLIBDIR% /c pdftohtml.cc
-%CXX% %LINKFLAGS% /Fepdftohtml.exe AcroForm.obj Annot.obj Array.obj BuiltinFont.obj BuiltinFontTables.obj Catalog.obj CharCodeToUnicode.obj CMap.obj Decrypt.obj Dict.obj Error.obj FontEncodingTables.obj Form.obj Function.obj Gfx.obj GfxFont.obj GfxState.obj GlobalParams.obj HTMLGen.obj JArithmeticDecoder.obj JBIG2Stream.obj JPXStream.obj Lexer.obj Link.obj NameToCharCode.obj Object.obj OptionalContent.obj Outline.obj OutputDev.obj Page.obj Parser.obj PDFDoc.obj PDFDocEncoding.obj PSTokenizer.obj SecurityHandler.obj SplashOutputDev.obj Stream.obj TextOutputDev.obj TextString.obj UnicodeMap.obj UnicodeTypeTable.obj XFAForm.obj XRef.obj Zoox.obj pdftohtml.obj ..\splash\splash.lib ..\fofi\fofi.lib ..\goo\Goo.lib %FT2DIR%\freetype2.lib %PNGDIR%\libpng.lib %ZLIBDIR%\zlib.lib shell32.lib user32.lib gdi32.lib advapi32.lib
-
-:noHTML
-
-cd ..

Added: branches/stable/source/src/libs/xpdf/xpdf-src/splash/CMakeLists.txt
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/splash/CMakeLists.txt	                        (rev 0)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/splash/CMakeLists.txt	2017-11-01 18:15:56 UTC (rev 780)
@@ -0,0 +1,47 @@
+#========================================================================
+#
+# splash/CMakeLists.txt
+#
+# CMake script for the splash library.
+#
+# Copyright 2015 Glyph & Cog, LLC
+#
+#========================================================================
+
+if (HAVE_SPLASH)
+  include_directories("${PROJECT_SOURCE_DIR}")
+  include_directories("${PROJECT_BINARY_DIR}")
+  include_directories("${PROJECT_SOURCE_DIR}/goo")
+  include_directories("${PROJECT_SOURCE_DIR}/fofi")
+  include_directories("${FREETYPE_INCLUDE_DIRS}")
+
+  if (HAVE_DTYPE4_H)
+    include_directories("${DTYPE_INCLUDE_DIR}")
+    set(DTYPE_SRCS
+        SplashDT4Font.cc SplashDT4FontEngine.cc SplashDT4FontFile.cc)
+  endif ()
+
+  add_library(splash_objs OBJECT
+    Splash.cc
+    SplashBitmap.cc
+    SplashClip.cc
+    SplashFTFont.cc
+    SplashFTFontEngine.cc
+    SplashFTFontFile.cc
+    SplashFont.cc
+    SplashFontEngine.cc
+    SplashFontFile.cc
+    SplashFontFileID.cc
+    SplashPath.cc
+    SplashPattern.cc
+    SplashScreen.cc
+    SplashState.cc
+    SplashXPath.cc
+    SplashXPathScanner.cc
+    ${DTYPE_SRCS}
+  )
+
+  add_library(splash
+    $<TARGET_OBJECTS:splash_objs>
+  )
+endif ()


Property changes on: branches/stable/source/src/libs/xpdf/xpdf-src/splash/CMakeLists.txt
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Deleted: branches/stable/source/src/libs/xpdf/xpdf-src/splash/Makefile.dep
===================================================================
Deleted: branches/stable/source/src/libs/xpdf/xpdf-src/splash/Makefile.in
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/splash/Makefile.in	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/splash/Makefile.in	2017-11-01 18:15:56 UTC (rev 780)
@@ -1,93 +0,0 @@
-#========================================================================
-#
-# Splash library Makefile
-#
-# Copyright 2003 Glyph & Cog, LLC
-#
-#========================================================================
-
-SHELL = /bin/sh
-
-srcdir = @srcdir@
-VPATH = @srcdir@
-
-GOOSRCDIR = $(srcdir)/../goo
-GOOLIBDIR = ../goo
-FOFISRCDIR = $(srcdir)/../fofi
-FOFILIBDIR = ../fofi
-
-CXXFLAGS = @CXXFLAGS@ @DEFS@ -I.. -I$(srcdir)/.. -I$(GOOSRCDIR) -I$(FOFISRCDIR) -I$(srcdir) @freetype2_CFLAGS@
-
-CXX = @CXX@
-AR = @AR@
-RANLIB = @RANLIB@
-
-LIBPREFIX = @LIBPREFIX@
-
-#------------------------------------------------------------------------
-
-.SUFFIXES: .cc
-
-.cc.o:
-	$(CXX) $(CXXFLAGS) -c $<
-
-#------------------------------------------------------------------------
-
-CXX_SRC = \
-	$(srcdir)/Splash.cc \
-	$(srcdir)/SplashBitmap.cc \
-	$(srcdir)/SplashClip.cc \
-	$(srcdir)/SplashFTFont.cc \
-	$(srcdir)/SplashFTFontEngine.cc \
-	$(srcdir)/SplashFTFontFile.cc \
-	$(srcdir)/SplashFont.cc \
-	$(srcdir)/SplashFontEngine.cc \
-	$(srcdir)/SplashFontFile.cc \
-	$(srcdir)/SplashFontFileID.cc \
-	$(srcdir)/SplashPath.cc \
-	$(srcdir)/SplashPattern.cc \
-	$(srcdir)/SplashScreen.cc \
-	$(srcdir)/SplashState.cc \
-	$(srcdir)/SplashXPath.cc \
-	$(srcdir)/SplashXPathScanner.cc
-
-#------------------------------------------------------------------------
-
-all: $(LIBPREFIX)splash.a
-
-#------------------------------------------------------------------------
-
-SPLASH_OBJS = \
-	Splash.o \
-	SplashBitmap.o \
-	SplashClip.o \
-	SplashFTFont.o \
-	SplashFTFontEngine.o \
-	SplashFTFontFile.o \
-	SplashFont.o \
-	SplashFontEngine.o \
-	SplashFontFile.o \
-	SplashFontFileID.o \
-	SplashPath.o \
-	SplashPattern.o \
-	SplashScreen.o \
-	SplashState.o \
-	SplashXPath.o \
-	SplashXPathScanner.o
-
-$(LIBPREFIX)splash.a: $(SPLASH_OBJS)
-	rm -f $(LIBPREFIX)splash.a
-	$(AR) $(LIBPREFIX)splash.a $(SPLASH_OBJS)
-	$(RANLIB) $(LIBPREFIX)splash.a
-
-#------------------------------------------------------------------------
-
-clean:
-	rm -f $(SPLASH_OBJS) $(LIBPREFIX)splash.a
-
-#------------------------------------------------------------------------
-
-depend:
-	$(CXX) $(CXXFLAGS) -MM $(CXX_SRC) >Makefile.dep
-
--include Makefile.dep

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/splash/Splash.cc
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/splash/Splash.cc	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/splash/Splash.cc	2017-11-01 18:15:56 UTC (rev 780)
@@ -15,7 +15,9 @@
 #include <stdlib.h>
 #include <string.h>
 #include <limits.h>
+#include <math.h>
 #include "gmem.h"
+#include "gmempp.h"
 #include "SplashErrorCodes.h"
 #include "SplashMath.h"
 #include "SplashBitmap.h"
@@ -29,10 +31,13 @@
 #include "SplashGlyphBitmap.h"
 #include "Splash.h"
 
+// the MSVC math.h doesn't define this
+#ifndef M_PI
+#define M_PI 3.14159265358979323846
+#endif
+
 //------------------------------------------------------------------------
 
-#define splashAAGamma 0.67
-
 // distance of Bezier control point from center for circle approximation
 // = (4 * (sqrt(2) - 1) / 3) * r
 #define bezierCircle ((SplashCoord)0.55228475)
@@ -123,17 +128,6 @@
 };
 
 //------------------------------------------------------------------------
-
-static void blendXor(SplashColorPtr src, SplashColorPtr dest,
-		     SplashColorPtr blend, SplashColorMode cm) {
-  int i;
-
-  for (i = 0; i < splashColorModeNComps[cm]; ++i) {
-    blend[i] = src[i] ^ dest[i];
-  }
-}
-
-//------------------------------------------------------------------------
 // modified region
 //------------------------------------------------------------------------
 
@@ -269,7 +263,7 @@
   Guchar shape, aSrc, aDest, alphaI, alphaIm1, alpha0, aResult;
   SplashColor cSrc, cDest, cBlend;
   Guchar shapeVal, cResult0, cResult1, cResult2, cResult3;
-  int cSrcStride, shapeStride, x, lastX, t, i;
+  int cSrcStride, shapeStride, x, lastX, t;
   SplashColorPtr destColorPtr;
   Guchar destColorMask;
   Guchar *destAlphaPtr;
@@ -396,49 +390,33 @@
       pipe->pattern->getColor(x, y, pipe->cSrcVal);
     }
 
+    cResult0 = cResult1 = cResult2 = cResult3 = 0; // make gcc happy
+
     if (pipe->noTransparency && !state->blendFunc) {
 
-      //----- write destination pixel
+      //----- result color
 
       switch (bitmap->mode) {
       case splashModeMono1:
+      case splashModeMono8:
 	cResult0 = state->grayTransfer[cSrcPtr[0]];
-	if (state->screen->test(x, y, cResult0)) {
-	  *destColorPtr |= destColorMask;
-	} else {
-	  *destColorPtr &= ~destColorMask;
-	}
-	destColorPtr += destColorMask & 1;
-	destColorMask = (destColorMask << 7) | (destColorMask >> 1);
 	break;
-      case splashModeMono8:
-	*destColorPtr++ = state->grayTransfer[cSrcPtr[0]];
-	break;
       case splashModeRGB8:
-	destColorPtr[0] = state->rgbTransferR[cSrcPtr[0]];
-	destColorPtr[1] = state->rgbTransferG[cSrcPtr[1]];
-	destColorPtr[2] = state->rgbTransferB[cSrcPtr[2]];
-	destColorPtr += 3;
-	break;
       case splashModeBGR8:
-	destColorPtr[0] = state->rgbTransferB[cSrcPtr[2]];
-	destColorPtr[1] = state->rgbTransferG[cSrcPtr[1]];
-	destColorPtr[2] = state->rgbTransferR[cSrcPtr[0]];
-	destColorPtr += 3;
+	cResult0 = state->rgbTransferR[cSrcPtr[0]];
+	cResult1 = state->rgbTransferG[cSrcPtr[1]];
+	cResult2 = state->rgbTransferB[cSrcPtr[2]];
 	break;
 #if SPLASH_CMYK
       case splashModeCMYK8:
-	destColorPtr[0] = state->cmykTransferC[cSrcPtr[0]];
-	destColorPtr[1] = state->cmykTransferM[cSrcPtr[1]];
-	destColorPtr[2] = state->cmykTransferY[cSrcPtr[2]];
-	destColorPtr[3] = state->cmykTransferK[cSrcPtr[3]];
-	destColorPtr += 4;
+	cResult0 = state->cmykTransferC[cSrcPtr[0]];
+	cResult1 = state->cmykTransferM[cSrcPtr[1]];
+	cResult2 = state->cmykTransferY[cSrcPtr[2]];
+	cResult3 = state->cmykTransferK[cSrcPtr[3]];
 	break;
 #endif
       }
-      if (destAlphaPtr) {
-	*destAlphaPtr++ = 255;
-      }
+      aResult = 255;
 
     } else { // if (noTransparency && !blendFunc)
 
@@ -516,17 +494,42 @@
 	aDest = 0xff;
       }
 
-      //----- overprint
+      //----- read source color; handle overprint
 
-      for (i = 0; i < bitmapComps; ++i) {
+      switch (bitmap->mode) {
+      case splashModeMono1:
+      case splashModeMono8:
+	cSrc[0] = state->grayTransfer[cSrcPtr[0]];
+	break;
+      case splashModeRGB8:
+      case splashModeBGR8:
+	cSrc[0] = state->rgbTransferR[cSrcPtr[0]];
+	cSrc[1] = state->rgbTransferG[cSrcPtr[1]];
+	cSrc[2] = state->rgbTransferB[cSrcPtr[2]];
+	break;
 #if SPLASH_CMYK
-	if (state->overprintMask & (1 << i)) {
-	  cSrc[i] = cSrcPtr[i];
+      case splashModeCMYK8:
+	if (state->overprintMask & 0x01) {
+	  cSrc[0] = state->cmykTransferC[cSrcPtr[0]];
 	} else {
-	  cSrc[i] = div255(aDest * cDest[i]);
+	  cSrc[0] = div255(aDest * cDest[0]);
 	}
-#else
-	cSrc[i] = cSrcPtr[i];
+	if (state->overprintMask & 0x02) {
+	  cSrc[1] = state->cmykTransferM[cSrcPtr[1]];
+	} else {
+	  cSrc[1] = div255(aDest * cDest[1]);
+	}
+	if (state->overprintMask & 0x04) {
+	  cSrc[2] = state->cmykTransferY[cSrcPtr[2]];
+	} else {
+	  cSrc[2] = div255(aDest * cDest[2]);
+	}
+	if (state->overprintMask & 0x08) {
+	  cSrc[3] = state->cmykTransferK[cSrcPtr[3]];
+	} else {
+	  cSrc[3] = div255(aDest * cDest[3]);
+	}
+	break;
 #endif
       }
 
@@ -629,32 +632,22 @@
 
       //----- result color
 
-      cResult0 = cResult1 = cResult2 = cResult3 = 0; // make gcc happy
-
       switch (pipe->resultColorCtrl) {
 
       case splashPipeResultColorNoAlphaBlendMono:
-	cResult0 = state->grayTransfer[div255((255 - aDest) * cSrc[0] +
-					      aDest * cBlend[0])];
+	cResult0 = div255((255 - aDest) * cSrc[0] + aDest * cBlend[0]);
 	break;
       case splashPipeResultColorNoAlphaBlendRGB:
-	cResult0 = state->rgbTransferR[div255((255 - aDest) * cSrc[0] +
-					      aDest * cBlend[0])];
-	cResult1 = state->rgbTransferG[div255((255 - aDest) * cSrc[1] +
-					      aDest * cBlend[1])];
-	cResult2 = state->rgbTransferB[div255((255 - aDest) * cSrc[2] +
-					      aDest * cBlend[2])];
+	cResult0 = div255((255 - aDest) * cSrc[0] + aDest * cBlend[0]);
+	cResult1 = div255((255 - aDest) * cSrc[1] + aDest * cBlend[1]);
+	cResult2 = div255((255 - aDest) * cSrc[2] + aDest * cBlend[2]);
 	break;
 #if SPLASH_CMYK
       case splashPipeResultColorNoAlphaBlendCMYK:
-	cResult0 = state->cmykTransferC[div255((255 - aDest) * cSrc[0] +
-					       aDest * cBlend[0])];
-	cResult1 = state->cmykTransferM[div255((255 - aDest) * cSrc[1] +
-					       aDest * cBlend[1])];
-	cResult2 = state->cmykTransferY[div255((255 - aDest) * cSrc[2] +
-					       aDest * cBlend[2])];
-	cResult3 = state->cmykTransferK[div255((255 - aDest) * cSrc[3] +
-					       aDest * cBlend[3])];
+	cResult0 = div255((255 - aDest) * cSrc[0] + aDest * cBlend[0]);
+	cResult1 = div255((255 - aDest) * cSrc[1] + aDest * cBlend[1]);
+	cResult2 = div255((255 - aDest) * cSrc[2] + aDest * cBlend[2]);
+	cResult3 = div255((255 - aDest) * cSrc[3] + aDest * cBlend[3]);
 	break;
 #endif
 
@@ -662,8 +655,7 @@
 	if (alphaI == 0) {
 	  cResult0 = 0;
 	} else {
-	  cResult0 = state->grayTransfer[((alphaI - aSrc) * cDest[0] +
-					  aSrc * cSrc[0]) / alphaI];
+	  cResult0 = ((alphaI - aSrc) * cDest[0] + aSrc * cSrc[0]) / alphaI;
 	}
 	break;
       case splashPipeResultColorAlphaNoBlendRGB:
@@ -672,12 +664,9 @@
 	  cResult1 = 0;
 	  cResult2 = 0;
 	} else {
-	  cResult0 = state->rgbTransferR[((alphaI - aSrc) * cDest[0] +
-					  aSrc * cSrc[0]) / alphaI];
-	  cResult1 = state->rgbTransferG[((alphaI - aSrc) * cDest[1] +
-					  aSrc * cSrc[1]) / alphaI];
-	  cResult2 = state->rgbTransferB[((alphaI - aSrc) * cDest[2] +
-					  aSrc * cSrc[2]) / alphaI];
+	  cResult0 = ((alphaI - aSrc) * cDest[0] + aSrc * cSrc[0]) / alphaI;
+	  cResult1 = ((alphaI - aSrc) * cDest[1] + aSrc * cSrc[1]) / alphaI;
+	  cResult2 = ((alphaI - aSrc) * cDest[2] + aSrc * cSrc[2]) / alphaI;
 	}
 	break;
 #if SPLASH_CMYK
@@ -688,14 +677,10 @@
 	  cResult2 = 0;
 	  cResult3 = 0;
 	} else {
-	  cResult0 = state->cmykTransferC[((alphaI - aSrc) * cDest[0] +
-					   aSrc * cSrc[0]) / alphaI];
-	  cResult1 = state->cmykTransferM[((alphaI - aSrc) * cDest[1] +
-					   aSrc * cSrc[1]) / alphaI];
-	  cResult2 = state->cmykTransferY[((alphaI - aSrc) * cDest[2] +
-					   aSrc * cSrc[2]) / alphaI];
-	  cResult3 = state->cmykTransferK[((alphaI - aSrc) * cDest[3] +
-					   aSrc * cSrc[3]) / alphaI];
+	  cResult0 = ((alphaI - aSrc) * cDest[0] + aSrc * cSrc[0]) / alphaI;
+	  cResult1 = ((alphaI - aSrc) * cDest[1] + aSrc * cSrc[1]) / alphaI;
+	  cResult2 = ((alphaI - aSrc) * cDest[2] + aSrc * cSrc[2]) / alphaI;
+	  cResult3 = ((alphaI - aSrc) * cDest[3] + aSrc * cSrc[3]) / alphaI;
 	}
 	break;
 #endif
@@ -704,10 +689,10 @@
 	if (alphaI == 0) {
 	  cResult0 = 0;
 	} else {
-	  cResult0 = state->grayTransfer[((alphaI - aSrc) * cDest[0] +
-					  aSrc * ((255 - alphaIm1) * cSrc[0] +
-						  alphaIm1 * cBlend[0]) / 255) /
-					 alphaI];
+	  cResult0 = ((alphaI - aSrc) * cDest[0] +
+		      aSrc * ((255 - alphaIm1) * cSrc[0] +
+			      alphaIm1 * cBlend[0]) / 255)
+	             / alphaI;
 	}
 	break;
       case splashPipeResultColorAlphaBlendRGB:
@@ -716,18 +701,18 @@
 	  cResult1 = 0;
 	  cResult2 = 0;
 	} else {
-	  cResult0 = state->rgbTransferR[((alphaI - aSrc) * cDest[0] +
-					  aSrc * ((255 - alphaIm1) * cSrc[0] +
-						  alphaIm1 * cBlend[0]) / 255) /
-					 alphaI];
-	  cResult1 = state->rgbTransferG[((alphaI - aSrc) * cDest[1] +
-					  aSrc * ((255 - alphaIm1) * cSrc[1] +
-						  alphaIm1 * cBlend[1]) / 255) /
-					 alphaI];
-	  cResult2 = state->rgbTransferB[((alphaI - aSrc) * cDest[2] +
-					  aSrc * ((255 - alphaIm1) * cSrc[2] +
-						  alphaIm1 * cBlend[2]) / 255) /
-					 alphaI];
+	  cResult0 = ((alphaI - aSrc) * cDest[0] +
+		      aSrc * ((255 - alphaIm1) * cSrc[0] +
+			      alphaIm1 * cBlend[0]) / 255)
+	             / alphaI;
+	  cResult1 = ((alphaI - aSrc) * cDest[1] +
+		      aSrc * ((255 - alphaIm1) * cSrc[1] +
+			      alphaIm1 * cBlend[1]) / 255)
+	             / alphaI;
+	  cResult2 = ((alphaI - aSrc) * cDest[2] +
+		      aSrc * ((255 - alphaIm1) * cSrc[2] +
+			      alphaIm1 * cBlend[2]) / 255)
+	             / alphaI;
 	}
 	break;
 #if SPLASH_CMYK
@@ -738,74 +723,70 @@
 	  cResult2 = 0;
 	  cResult3 = 0;
 	} else {
-	  cResult0 =
-	    state->cmykTransferC[((alphaI - aSrc) * cDest[0] +
-				  aSrc * ((255 - alphaIm1) * cSrc[0] +
-					  alphaIm1 * cBlend[0]) / 255) /
-				 alphaI];
-	  cResult1 =
-	    state->cmykTransferM[((alphaI - aSrc) * cDest[1] +
-				  aSrc * ((255 - alphaIm1) * cSrc[1] +
-					  alphaIm1 * cBlend[1]) / 255) /
-				 alphaI];
-	  cResult2 =
-	    state->cmykTransferY[((alphaI - aSrc) * cDest[2] +
-				  aSrc * ((255 - alphaIm1) * cSrc[2] +
-					  alphaIm1 * cBlend[2]) / 255) /
-				 alphaI];
-	  cResult3 =
-	    state->cmykTransferK[((alphaI - aSrc) * cDest[3] +
-				  aSrc * ((255 - alphaIm1) * cSrc[3] +
-					  alphaIm1 * cBlend[3]) / 255) /
-				 alphaI];
+	  cResult0 = ((alphaI - aSrc) * cDest[0] +
+		      aSrc * ((255 - alphaIm1) * cSrc[0] +
+			      alphaIm1 * cBlend[0]) / 255)
+	             / alphaI;
+	  cResult1 = ((alphaI - aSrc) * cDest[1] +
+		      aSrc * ((255 - alphaIm1) * cSrc[1] +
+			      alphaIm1 * cBlend[1]) / 255)
+	             / alphaI;
+	  cResult2 = ((alphaI - aSrc) * cDest[2] +
+		      aSrc * ((255 - alphaIm1) * cSrc[2] +
+			      alphaIm1 * cBlend[2]) / 255)
+	             / alphaI;
+	  cResult3 = ((alphaI - aSrc) * cDest[3] +
+		      aSrc * ((255 - alphaIm1) * cSrc[3] +
+			      alphaIm1 * cBlend[3]) / 255)
+	             / alphaI;
 	}
 	break;
 #endif
       }
 
-      //----- write destination pixel
+    } // if (noTransparency && !blendFunc)
 
-      switch (bitmap->mode) {
-      case splashModeMono1:
-	if (state->screen->test(x, y, cResult0)) {
-	  *destColorPtr |= destColorMask;
-	} else {
-	  *destColorPtr &= ~destColorMask;
-	}
-	destColorPtr += destColorMask & 1;
-	destColorMask = (destColorMask << 7) | (destColorMask >> 1);
-	break;
-      case splashModeMono8:
-	*destColorPtr++ = cResult0;
-	break;
-      case splashModeRGB8:
-	destColorPtr[0] = cResult0;
-	destColorPtr[1] = cResult1;
-	destColorPtr[2] = cResult2;
-	destColorPtr += 3;
-	break;
-      case splashModeBGR8:
-	destColorPtr[0] = cResult2;
-	destColorPtr[1] = cResult1;
-	destColorPtr[2] = cResult0;
-	destColorPtr += 3;
-	break;
+    //----- write destination pixel
+
+    switch (bitmap->mode) {
+    case splashModeMono1:
+      if (state->screen->test(x, y, cResult0)) {
+	*destColorPtr |= destColorMask;
+      } else {
+	*destColorPtr &= ~destColorMask;
+      }
+      destColorPtr += destColorMask & 1;
+      destColorMask = (destColorMask << 7) | (destColorMask >> 1);
+      break;
+    case splashModeMono8:
+      *destColorPtr++ = cResult0;
+      break;
+    case splashModeRGB8:
+      destColorPtr[0] = cResult0;
+      destColorPtr[1] = cResult1;
+      destColorPtr[2] = cResult2;
+      destColorPtr += 3;
+      break;
+    case splashModeBGR8:
+      destColorPtr[0] = cResult2;
+      destColorPtr[1] = cResult1;
+      destColorPtr[2] = cResult0;
+      destColorPtr += 3;
+      break;
 #if SPLASH_CMYK
-      case splashModeCMYK8:
-	destColorPtr[0] = cResult0;
-	destColorPtr[1] = cResult1;
-	destColorPtr[2] = cResult2;
-	destColorPtr[3] = cResult3;
-	destColorPtr += 4;
-	break;
+    case splashModeCMYK8:
+      destColorPtr[0] = cResult0;
+      destColorPtr[1] = cResult1;
+      destColorPtr[2] = cResult2;
+      destColorPtr[3] = cResult3;
+      destColorPtr += 4;
+      break;
 #endif
-      }
-      if (destAlphaPtr) {
-	*destAlphaPtr++ = aResult;
-      }
+    }
+    if (destAlphaPtr) {
+      *destAlphaPtr++ = aResult;
+    }
 
-    } // if (noTransparency && !blendFunc)
-
     cSrcPtr += cSrcStride;
     shapePtr2 += shapeStride;
   } // for (x ...)
@@ -821,6 +802,7 @@
   Guchar cResult0;
   SplashColorPtr destColorPtr;
   Guchar destColorMask;
+  SplashScreenCursor screenCursor;
   int cSrcStride, x;
 
   if (cSrcPtr) {
@@ -839,11 +821,13 @@
   destColorPtr = &bitmap->data[y * bitmap->rowSize + (x0 >> 3)];
   destColorMask = 0x80 >> (x0 & 7);
 
+  screenCursor = state->screen->getTestCursor(y);
+
   for (x = x0; x <= x1; ++x) {
 
     //----- write destination pixel
     cResult0 = state->grayTransfer[cSrcPtr[0]];
-    if (state->screen->test(x, y, cResult0)) {
+    if (state->screen->testWithCursor(screenCursor, x, cResult0)) {
       *destColorPtr |= destColorMask;
     } else {
       *destColorPtr &= ~destColorMask;
@@ -1013,9 +997,10 @@
 // bitmap->mode == splashModeMono1 && !bitmap->alpha
 void Splash::pipeRunShapeMono1(SplashPipe *pipe, int x0, int x1, int y,
 			       Guchar *shapePtr, SplashColorPtr cSrcPtr) {
-  Guchar shape, aSrc, cDest0, cResult0;
+  Guchar shape, aSrc, cSrc0, cDest0, cResult0;
   SplashColorPtr destColorPtr;
   Guchar destColorMask;
+  SplashScreenCursor screenCursor;
   int cSrcStride, x, lastX;
 
   if (cSrcPtr) {
@@ -1041,6 +1026,8 @@
   destColorPtr = &bitmap->data[y * bitmap->rowSize + (x0 >> 3)];
   destColorMask = 0x80 >> (x0 & 7);
 
+  screenCursor = state->screen->getTestCursor(y);
+
   for (x = x0; x <= x1; ++x) {
 
     //----- shape
@@ -1054,19 +1041,27 @@
     }
     lastX = x;
 
-    //----- read destination pixel
-    cDest0 = (*destColorPtr & destColorMask) ? 0xff : 0x00;
+    //----- source color
+    cSrc0 = state->grayTransfer[cSrcPtr[0]];
 
     //----- source alpha
     aSrc = shape;
 
-    //----- result color
-    // note: aDest = alphaI = aResult = 0xff
-    cResult0 = state->grayTransfer[(Guchar)div255((0xff - aSrc) * cDest0 +
-						  aSrc * cSrcPtr[0])];
+    //----- special case for aSrc = 255
+    if (aSrc == 255) {
+      cResult0 = cSrc0;
+    } else {
 
+      //----- read destination pixel
+      cDest0 = (*destColorPtr & destColorMask) ? 0xff : 0x00;
+
+      //----- result color
+      // note: aDest = alphaI = aResult = 0xff
+      cResult0 = (Guchar)div255((0xff - aSrc) * cDest0 + aSrc * cSrc0);
+    }
+
     //----- write destination pixel
-    if (state->screen->test(x, y, cResult0)) {
+    if (state->screen->testWithCursor(screenCursor, x, cResult0)) {
       *destColorPtr |= destColorMask;
     } else {
       *destColorPtr &= ~destColorMask;
@@ -1086,7 +1081,7 @@
 // bitmap->mode == splashModeMono8 && bitmap->alpha
 void Splash::pipeRunShapeMono8(SplashPipe *pipe, int x0, int x1, int y,
 			       Guchar *shapePtr, SplashColorPtr cSrcPtr) {
-  Guchar shape, aSrc, aDest, alphaI, aResult, cDest0, cResult0;
+  Guchar shape, aSrc, aDest, alphaI, aResult, cSrc0, cDest0, cResult0;
   SplashColorPtr destColorPtr;
   Guchar *destAlphaPtr;
   int cSrcStride, x, lastX;
@@ -1127,23 +1122,37 @@
     }
     lastX = x;
 
-    //----- read destination pixel
-    cDest0 = *destColorPtr;
-    aDest = *destAlphaPtr;
+    //----- source color
+    cSrc0 = state->grayTransfer[cSrcPtr[0]];
 
     //----- source alpha
     aSrc = shape;
 
-    //----- result alpha and non-isolated group element correction
-    aResult = aSrc + aDest - div255(aSrc * aDest);
-    alphaI = aResult;
+    //----- special case for aSrc = 255
+    if (aSrc == 255) {
+      aResult = 255;
+      cResult0 = cSrc0;
+    } else {
 
-    //----- result color
-    if (alphaI == 0) {
-      cResult0 = 0;
-    } else {
-      cResult0 = state->grayTransfer[(Guchar)(((alphaI - aSrc) * cDest0 +
-					       aSrc * cSrcPtr[0]) / alphaI)];
+      //----- read destination alpha
+      aDest = *destAlphaPtr;
+
+      //----- special case for aDest = 0
+      if (aDest == 0) {
+	aResult = aSrc;
+	cResult0 = cSrc0;
+      } else {
+
+	//----- read destination pixel
+	cDest0 = *destColorPtr;
+
+	//----- result alpha and non-isolated group element correction
+	aResult = aSrc + aDest - div255(aSrc * aDest);
+	alphaI = aResult;
+
+	//----- result color
+	cResult0 = (Guchar)(((alphaI - aSrc) * cDest0 + aSrc * cSrc0) / alphaI);
+      }
     }
 
     //----- write destination pixel
@@ -1163,6 +1172,7 @@
 void Splash::pipeRunShapeRGB8(SplashPipe *pipe, int x0, int x1, int y,
 			      Guchar *shapePtr, SplashColorPtr cSrcPtr) {
   Guchar shape, aSrc, aDest, alphaI, aResult;
+  Guchar cSrc0, cSrc1, cSrc2;
   Guchar cDest0, cDest1, cDest2;
   Guchar cResult0, cResult1, cResult2;
   SplashColorPtr destColorPtr;
@@ -1205,31 +1215,47 @@
     }
     lastX = x;
 
-    //----- read destination pixel
-    cDest0 = destColorPtr[0];
-    cDest1 = destColorPtr[1];
-    cDest2 = destColorPtr[2];
-    aDest = *destAlphaPtr;
+    //----- source color
+    cSrc0 = state->rgbTransferR[cSrcPtr[0]];
+    cSrc1 = state->rgbTransferG[cSrcPtr[1]];
+    cSrc2 = state->rgbTransferB[cSrcPtr[2]];
 
     //----- source alpha
     aSrc = shape;
 
-    //----- result alpha and non-isolated group element correction
-    aResult = aSrc + aDest - div255(aSrc * aDest);
-    alphaI = aResult;
+    //----- special case for aSrc = 255
+    if (aSrc == 255) {
+      aResult = 255;
+      cResult0 = cSrc0;
+      cResult1 = cSrc1;
+      cResult2 = cSrc2;
+    } else {
 
-    //----- result color
-    if (alphaI == 0) {
-      cResult0 = 0;
-      cResult1 = 0;
-      cResult2 = 0;
-    } else {
-      cResult0 = state->rgbTransferR[(Guchar)(((alphaI - aSrc) * cDest0 +
-					       aSrc * cSrcPtr[0]) / alphaI)];
-      cResult1 = state->rgbTransferG[(Guchar)(((alphaI - aSrc) * cDest1 +
-					       aSrc * cSrcPtr[1]) / alphaI)];
-      cResult2 = state->rgbTransferB[(Guchar)(((alphaI - aSrc) * cDest2 +
-					       aSrc * cSrcPtr[2]) / alphaI)];
+      //----- read destination alpha
+      aDest = *destAlphaPtr;
+
+      //----- special case for aDest = 0
+      if (aDest == 0) {
+	aResult = aSrc;
+	cResult0 = cSrc0;
+	cResult1 = cSrc1;
+	cResult2 = cSrc2;
+      } else {
+
+	//----- read destination pixel
+	cDest0 = destColorPtr[0];
+	cDest1 = destColorPtr[1];
+	cDest2 = destColorPtr[2];
+
+	//----- result alpha and non-isolated group element correction
+	aResult = aSrc + aDest - div255(aSrc * aDest);
+	alphaI = aResult;
+
+	//----- result color
+	cResult0 = (Guchar)(((alphaI - aSrc) * cDest0 + aSrc * cSrc0) / alphaI);
+	cResult1 = (Guchar)(((alphaI - aSrc) * cDest1 + aSrc * cSrc1) / alphaI);
+	cResult2 = (Guchar)(((alphaI - aSrc) * cDest2 + aSrc * cSrc2) / alphaI);
+      }
     }
 
     //----- write destination pixel
@@ -1252,6 +1278,7 @@
 void Splash::pipeRunShapeBGR8(SplashPipe *pipe, int x0, int x1, int y,
 			      Guchar *shapePtr, SplashColorPtr cSrcPtr) {
   Guchar shape, aSrc, aDest, alphaI, aResult;
+  Guchar cSrc0, cSrc1, cSrc2;
   Guchar cDest0, cDest1, cDest2;
   Guchar cResult0, cResult1, cResult2;
   SplashColorPtr destColorPtr;
@@ -1294,31 +1321,47 @@
     }
     lastX = x;
 
-    //----- read destination pixel
-    cDest0 = destColorPtr[2];
-    cDest1 = destColorPtr[1];
-    cDest2 = destColorPtr[0];
-    aDest = *destAlphaPtr;
+    //----- source color
+    cSrc0 = state->rgbTransferR[cSrcPtr[0]];
+    cSrc1 = state->rgbTransferG[cSrcPtr[1]];
+    cSrc2 = state->rgbTransferB[cSrcPtr[2]];
 
     //----- source alpha
     aSrc = shape;
 
-    //----- result alpha and non-isolated group element correction
-    aResult = aSrc + aDest - div255(aSrc * aDest);
-    alphaI = aResult;
+    //----- special case for aSrc = 255
+    if (aSrc == 255) {
+      aResult = 255;
+      cResult0 = cSrc0;
+      cResult1 = cSrc1;
+      cResult2 = cSrc2;
+    } else {
 
-    //----- result color
-    if (alphaI == 0) {
-      cResult0 = 0;
-      cResult1 = 0;
-      cResult2 = 0;
-    } else {
-      cResult0 = state->rgbTransferR[(Guchar)(((alphaI - aSrc) * cDest0 +
-					       aSrc * cSrcPtr[0]) / alphaI)];
-      cResult1 = state->rgbTransferG[(Guchar)(((alphaI - aSrc) * cDest1 +
-					       aSrc * cSrcPtr[1]) / alphaI)];
-      cResult2 = state->rgbTransferB[(Guchar)(((alphaI - aSrc) * cDest2 +
-					       aSrc * cSrcPtr[2]) / alphaI)];
+      //----- read destination alpha
+      aDest = *destAlphaPtr;
+
+      //----- special case for aDest = 0
+      if (aDest == 0) {
+	aResult = aSrc;
+	cResult0 = cSrc0;
+	cResult1 = cSrc1;
+	cResult2 = cSrc2;
+      } else {
+
+	//----- read destination pixel
+	cDest0 = destColorPtr[2];
+	cDest1 = destColorPtr[1];
+	cDest2 = destColorPtr[0];
+
+	//----- result alpha and non-isolated group element correction
+	aResult = aSrc + aDest - div255(aSrc * aDest);
+	alphaI = aResult;
+
+	//----- result color
+	cResult0 = (Guchar)(((alphaI - aSrc) * cDest0 + aSrc * cSrc0) / alphaI);
+	cResult1 = (Guchar)(((alphaI - aSrc) * cDest1 + aSrc * cSrc1) / alphaI);
+	cResult2 = (Guchar)(((alphaI - aSrc) * cDest2 + aSrc * cSrc2) / alphaI);
+      }
     }
 
     //----- write destination pixel
@@ -1394,22 +1437,22 @@
 
     //----- overprint
     if (state->overprintMask & 1) {
-      cSrc0 = cSrcPtr[0];
+      cSrc0 = state->cmykTransferC[cSrcPtr[0]];
     } else {
       cSrc0 = div255(aDest * cDest0);
     }
     if (state->overprintMask & 2) {
-      cSrc1 = cSrcPtr[1];
+      cSrc1 = state->cmykTransferM[cSrcPtr[1]];
     } else {
       cSrc1 = div255(aDest * cDest1);
     }
     if (state->overprintMask & 4) {
-      cSrc2 = cSrcPtr[2];
+      cSrc2 = state->cmykTransferY[cSrcPtr[2]];
     } else {
       cSrc2 = div255(aDest * cDest2);
     }
     if (state->overprintMask & 8) {
-      cSrc3 = cSrcPtr[3];
+      cSrc3 = state->cmykTransferK[cSrcPtr[3]];
     } else {
       cSrc3 = div255(aDest * cDest3);
     }
@@ -1417,25 +1460,34 @@
     //----- source alpha
     aSrc = shape;
 
-    //----- result alpha and non-isolated group element correction
-    aResult = aSrc + aDest - div255(aSrc * aDest);
-    alphaI = aResult;
+    //----- special case for aSrc = 255
+    if (aSrc == 255) {
+      aResult = 255;
+      cResult0 = cSrc0;
+      cResult1 = cSrc1;
+      cResult2 = cSrc2;
+      cResult3 = cSrc3;
+    } else {
 
-    //----- result color
-    if (alphaI == 0) {
-      cResult0 = 0;
-      cResult1 = 0;
-      cResult2 = 0;
-      cResult3 = 0;
-    } else {
-      cResult0 = state->cmykTransferC[(Guchar)(((alphaI - aSrc) * cDest0 +
-						aSrc * cSrc0) / alphaI)];
-      cResult1 = state->cmykTransferM[(Guchar)(((alphaI - aSrc) * cDest1 +
-						aSrc * cSrc1) / alphaI)];
-      cResult2 = state->cmykTransferY[(Guchar)(((alphaI - aSrc) * cDest2 +
-						aSrc * cSrc2) / alphaI)];
-      cResult3 = state->cmykTransferK[(Guchar)(((alphaI - aSrc) * cDest3 +
-						aSrc * cSrc3) / alphaI)];
+      //----- special case for aDest = 0
+      if (aDest == 0) {
+	aResult = aSrc;
+	cResult0 = cSrc0;
+	cResult1 = cSrc1;
+	cResult2 = cSrc2;
+	cResult3 = cSrc3;
+      } else {
+
+	//----- result alpha and non-isolated group element correction
+	aResult = aSrc + aDest - div255(aSrc * aDest);
+	alphaI = aResult;
+
+	//----- result color
+	cResult0 = (Guchar)(((alphaI - aSrc) * cDest0 + aSrc * cSrc0) / alphaI);
+	cResult1 = (Guchar)(((alphaI - aSrc) * cDest1 + aSrc * cSrc1) / alphaI);
+	cResult2 = (Guchar)(((alphaI - aSrc) * cDest2 + aSrc * cSrc2) / alphaI);
+	cResult3 = (Guchar)(((alphaI - aSrc) * cDest3 + aSrc * cSrc3) / alphaI);
+      }
     }
 
     //----- write destination pixel
@@ -1462,9 +1514,10 @@
 // bitmap->mode == splashModeMono1 && !bitmap->alpha
 void Splash::pipeRunAAMono1(SplashPipe *pipe, int x0, int x1, int y,
 			    Guchar *shapePtr, SplashColorPtr cSrcPtr) {
-  Guchar shape, aSrc, cDest0, cResult0;
+  Guchar shape, aSrc, cSrc0, cDest0, cResult0;
   SplashColorPtr destColorPtr;
   Guchar destColorMask;
+  SplashScreenCursor screenCursor;
   int cSrcStride, x, lastX;
 
   if (cSrcPtr) {
@@ -1490,6 +1543,8 @@
   destColorPtr = &bitmap->data[y * bitmap->rowSize + (x0 >> 3)];
   destColorMask = 0x80 >> (x0 & 7);
 
+  screenCursor = state->screen->getTestCursor(y);
+
   for (x = x0; x <= x1; ++x) {
 
     //----- shape
@@ -1506,16 +1561,18 @@
     //----- read destination pixel
     cDest0 = (*destColorPtr & destColorMask) ? 0xff : 0x00;
 
+    //----- source color
+    cSrc0 = state->grayTransfer[cSrcPtr[0]];
+
     //----- source alpha
     aSrc = div255(pipe->aInput * shape);
 
     //----- result color
     // note: aDest = alphaI = aResult = 0xff
-    cResult0 = state->grayTransfer[(Guchar)div255((0xff - aSrc) * cDest0 +
-						  aSrc * cSrcPtr[0])];
+    cResult0 = (Guchar)div255((0xff - aSrc) * cDest0 + aSrc * cSrc0);
 
     //----- write destination pixel
-    if (state->screen->test(x, y, cResult0)) {
+    if (state->screen->testWithCursor(screenCursor, x, cResult0)) {
       *destColorPtr |= destColorMask;
     } else {
       *destColorPtr &= ~destColorMask;
@@ -1537,7 +1594,7 @@
 // bitmap->mode == splashModeMono8 && bitmap->alpha
 void Splash::pipeRunAAMono8(SplashPipe *pipe, int x0, int x1, int y,
 			    Guchar *shapePtr, SplashColorPtr cSrcPtr) {
-  Guchar shape, aSrc, aDest, alphaI, aResult, cDest0, cResult0;
+  Guchar shape, aSrc, aDest, alphaI, aResult, cSrc0, cDest0, cResult0;
   SplashColorPtr destColorPtr;
   Guchar *destAlphaPtr;
   int cSrcStride, x, lastX;
@@ -1582,6 +1639,9 @@
     cDest0 = *destColorPtr;
     aDest = *destAlphaPtr;
 
+    //----- source color
+    cSrc0 = state->grayTransfer[cSrcPtr[0]];
+
     //----- source alpha
     aSrc = div255(pipe->aInput * shape);
 
@@ -1593,8 +1653,7 @@
     if (alphaI == 0) {
       cResult0 = 0;
     } else {
-      cResult0 = state->grayTransfer[(Guchar)(((alphaI - aSrc) * cDest0 +
-					       aSrc * cSrcPtr[0]) / alphaI)];
+      cResult0 = (Guchar)(((alphaI - aSrc) * cDest0 + aSrc * cSrc0) / alphaI);
     }
 
     //----- write destination pixel
@@ -1616,6 +1675,7 @@
 void Splash::pipeRunAARGB8(SplashPipe *pipe, int x0, int x1, int y,
 			   Guchar *shapePtr, SplashColorPtr cSrcPtr) {
   Guchar shape, aSrc, aDest, alphaI, aResult;
+  Guchar cSrc0, cSrc1, cSrc2;
   Guchar cDest0, cDest1, cDest2;
   Guchar cResult0, cResult1, cResult2;
   SplashColorPtr destColorPtr;
@@ -1664,6 +1724,11 @@
     cDest2 = destColorPtr[2];
     aDest = *destAlphaPtr;
 
+    //----- source color
+    cSrc0 = state->rgbTransferR[cSrcPtr[0]];
+    cSrc1 = state->rgbTransferG[cSrcPtr[1]];
+    cSrc2 = state->rgbTransferB[cSrcPtr[2]];
+
     //----- source alpha
     aSrc = div255(pipe->aInput * shape);
 
@@ -1677,12 +1742,9 @@
       cResult1 = 0;
       cResult2 = 0;
     } else {
-      cResult0 = state->rgbTransferR[(Guchar)(((alphaI - aSrc) * cDest0 +
-					       aSrc * cSrcPtr[0]) / alphaI)];
-      cResult1 = state->rgbTransferG[(Guchar)(((alphaI - aSrc) * cDest1 +
-					       aSrc * cSrcPtr[1]) / alphaI)];
-      cResult2 = state->rgbTransferB[(Guchar)(((alphaI - aSrc) * cDest2 +
-					       aSrc * cSrcPtr[2]) / alphaI)];
+      cResult0 = (Guchar)(((alphaI - aSrc) * cDest0 + aSrc * cSrc0) / alphaI);
+      cResult1 = (Guchar)(((alphaI - aSrc) * cDest1 + aSrc * cSrc1) / alphaI);
+      cResult2 = (Guchar)(((alphaI - aSrc) * cDest2 + aSrc * cSrc2) / alphaI);
     }
 
     //----- write destination pixel
@@ -1707,6 +1769,7 @@
 void Splash::pipeRunAABGR8(SplashPipe *pipe, int x0, int x1, int y,
 			   Guchar *shapePtr, SplashColorPtr cSrcPtr) {
   Guchar shape, aSrc, aDest, alphaI, aResult;
+  Guchar cSrc0, cSrc1, cSrc2;
   Guchar cDest0, cDest1, cDest2;
   Guchar cResult0, cResult1, cResult2;
   SplashColorPtr destColorPtr;
@@ -1755,6 +1818,11 @@
     cDest2 = destColorPtr[0];
     aDest = *destAlphaPtr;
 
+    //----- source color
+    cSrc0 = state->rgbTransferR[cSrcPtr[0]];
+    cSrc1 = state->rgbTransferG[cSrcPtr[1]];
+    cSrc2 = state->rgbTransferB[cSrcPtr[2]];
+
     //----- source alpha
     aSrc = div255(pipe->aInput * shape);
 
@@ -1768,12 +1836,9 @@
       cResult1 = 0;
       cResult2 = 0;
     } else {
-      cResult0 = state->rgbTransferR[(Guchar)(((alphaI - aSrc) * cDest0 +
-					       aSrc * cSrcPtr[0]) / alphaI)];
-      cResult1 = state->rgbTransferG[(Guchar)(((alphaI - aSrc) * cDest1 +
-					       aSrc * cSrcPtr[1]) / alphaI)];
-      cResult2 = state->rgbTransferB[(Guchar)(((alphaI - aSrc) * cDest2 +
-					       aSrc * cSrcPtr[2]) / alphaI)];
+      cResult0 = (Guchar)(((alphaI - aSrc) * cDest0 + aSrc * cSrc0) / alphaI);
+      cResult1 = (Guchar)(((alphaI - aSrc) * cDest1 + aSrc * cSrc1) / alphaI);
+      cResult2 = (Guchar)(((alphaI - aSrc) * cDest2 + aSrc * cSrc2) / alphaI);
     }
 
     //----- write destination pixel
@@ -1851,22 +1916,22 @@
 
     //----- overprint
     if (state->overprintMask & 1) {
-      cSrc0 = cSrcPtr[0];
+      cSrc0 = state->cmykTransferC[cSrcPtr[0]];
     } else {
       cSrc0 = div255(aDest * cDest0);
     }
     if (state->overprintMask & 2) {
-      cSrc1 = cSrcPtr[1];
+      cSrc1 = state->cmykTransferM[cSrcPtr[1]];
     } else {
       cSrc1 = div255(aDest * cDest1);
     }
     if (state->overprintMask & 4) {
-      cSrc2 = cSrcPtr[2];
+      cSrc2 = state->cmykTransferY[cSrcPtr[2]];
     } else {
       cSrc2 = div255(aDest * cDest2);
     }
     if (state->overprintMask & 8) {
-      cSrc3 = cSrcPtr[3];
+      cSrc3 = state->cmykTransferK[cSrcPtr[3]];
     } else {
       cSrc3 = div255(aDest * cDest3);
     }
@@ -1885,14 +1950,10 @@
       cResult2 = 0;
       cResult3 = 0;
     } else {
-      cResult0 = state->cmykTransferC[(Guchar)(((alphaI - aSrc) * cDest0 +
-						aSrc * cSrc0) / alphaI)];
-      cResult1 = state->cmykTransferM[(Guchar)(((alphaI - aSrc) * cDest1 +
-						aSrc * cSrc1) / alphaI)];
-      cResult2 = state->cmykTransferY[(Guchar)(((alphaI - aSrc) * cDest2 +
-						aSrc * cSrc2) / alphaI)];
-      cResult3 = state->cmykTransferK[(Guchar)(((alphaI - aSrc) * cDest3 +
-						aSrc * cSrc3) / alphaI)];
+      cResult0 = (Guchar)(((alphaI - aSrc) * cDest0 + aSrc * cSrc0) / alphaI);
+      cResult1 = (Guchar)(((alphaI - aSrc) * cDest1 + aSrc * cSrc1) / alphaI);
+      cResult2 = (Guchar)(((alphaI - aSrc) * cDest2 + aSrc * cSrc2) / alphaI);
+      cResult3 = (Guchar)(((alphaI - aSrc) * cDest3 + aSrc * cSrc3) / alphaI);
     }
 
     //----- write destination pixel
@@ -1931,8 +1992,6 @@
 
 Splash::Splash(SplashBitmap *bitmapA, GBool vectorAntialiasA,
 	       SplashScreenParams *screenParams) {
-  int i;
-
   bitmap = bitmapA;
   bitmapComps = splashColorModeNComps[bitmap->mode];
   vectorAntialias = vectorAntialiasA;
@@ -1940,13 +1999,12 @@
   state = new SplashState(bitmap->width, bitmap->height, vectorAntialias,
 			  screenParams);
   scanBuf = (Guchar *)gmalloc(bitmap->width);
-  if (vectorAntialias) {
-    for (i = 0; i <= 255; ++i) {
-      aaGamma[i] = (Guchar)splashRound(
-			       splashPow((SplashCoord)i / (SplashCoord)255,
-					 splashAAGamma) * 255);
-    }
+  if (bitmap->mode == splashModeMono1) {
+    scanBuf2 = (Guchar *)gmalloc(bitmap->width);
+  } else {
+    scanBuf2 = NULL;
   }
+  groupBackBitmap = NULL;
   minLineWidth = 0;
   clearModRegion();
   debugMode = gFalse;
@@ -1954,8 +2012,6 @@
 
 Splash::Splash(SplashBitmap *bitmapA, GBool vectorAntialiasA,
 	       SplashScreen *screenA) {
-  int i;
-
   bitmap = bitmapA;
   bitmapComps = splashColorModeNComps[bitmap->mode];
   vectorAntialias = vectorAntialiasA;
@@ -1963,13 +2019,12 @@
   state = new SplashState(bitmap->width, bitmap->height, vectorAntialias,
 			  screenA);
   scanBuf = (Guchar *)gmalloc(bitmap->width);
-  if (vectorAntialias) {
-    for (i = 0; i <= 255; ++i) {
-      aaGamma[i] = (Guchar)splashRound(
-			       splashPow((SplashCoord)i / (SplashCoord)255,
-					 splashAAGamma) * 255);
-    }
+  if (bitmap->mode == splashModeMono1) {
+    scanBuf2 = (Guchar *)gmalloc(bitmap->width);
+  } else {
+    scanBuf2 = NULL;
   }
+  groupBackBitmap = NULL;
   minLineWidth = 0;
   clearModRegion();
   debugMode = gFalse;
@@ -1981,6 +2036,7 @@
   }
   delete state;
   gfree(scanBuf);
+  gfree(scanBuf2);
 }
 
 //------------------------------------------------------------------------
@@ -2047,7 +2103,7 @@
   return state->lineDashPhase;
 }
 
-GBool Splash::getStrokeAdjust() {
+SplashStrokeAdjustMode Splash::getStrokeAdjust() {
   return state->strokeAdjust;
 }
 
@@ -2128,7 +2184,7 @@
   state->setLineDash(lineDash, lineDashLength, lineDashPhase);
 }
 
-void Splash::setStrokeAdjust(GBool strokeAdjust) {
+void Splash::setStrokeAdjust(SplashStrokeAdjustMode strokeAdjust) {
   state->strokeAdjust = strokeAdjust;
 }
 
@@ -2169,6 +2225,10 @@
   state->overprintMask = overprintMask;
 }
 
+void Splash::setEnablePathSimplification(GBool en) {
+  state->enablePathSimplification = en;
+}
+
 //------------------------------------------------------------------------
 // state save/restore
 //------------------------------------------------------------------------
@@ -2300,7 +2360,8 @@
 
 SplashError Splash::stroke(SplashPath *path) {
   SplashPath *path2, *dPath;
-  SplashCoord t0, t1, t2, t3, w, w2;
+  SplashCoord t0, t1, t2, t3, w, w2, lineDashMax, lineDashTotal;
+  int lineCap, lineJoin, i;
 
   if (debugMode) {
     printf("stroke [dash:%d] [width:%.2f]:\n",
@@ -2312,15 +2373,6 @@
     return splashErrEmptyPath;
   }
   path2 = flattenPath(path, state->matrix, state->flatness);
-  if (state->lineDashLength > 0) {
-    dPath = makeDashedPath(path2);
-    delete path2;
-    path2 = dPath;
-    if (path2->length == 0) {
-      delete path2;
-      return splashErrEmptyPath;
-    }
-  }
 
   // Compute an approximation of the transformed line width.
   // Given a CTM of [m0 m1],
@@ -2341,10 +2393,62 @@
     w = (t1 < t2) ? t1 : t2;
   }
   w2 = w * state->lineWidth;
+
+  // construct the dashed path
+  if (state->lineDashLength > 0) {
+
+    // check the maximum transformed dash element length (using the
+    // same approximation as for line width) -- if it's less than 0.1
+    // pixel, don't apply the dash pattern; this avoids a huge
+    // performance/memory hit with PDF files that use absurd dash
+    // patterns like [0.0007 0.0003]
+    lineDashTotal = 0;
+    lineDashMax = 0;
+    for (i = 0; i < state->lineDashLength; ++i) {
+      lineDashTotal += state->lineDash[i];
+      if (state->lineDash[i] > lineDashMax) {
+	lineDashMax = state->lineDash[i];
+      }
+    }
+    // Acrobat simply draws nothing if the dash array is [0]
+    if (lineDashTotal == 0) {
+      delete path2;
+      return splashOk;
+    }
+    if (w * lineDashMax > 0.1) {
+
+      dPath = makeDashedPath(path2);
+      delete path2;
+      path2 = dPath;
+      if (path2->length == 0) {
+	delete path2;
+	return splashErrEmptyPath;
+      }
+    }
+  }
+
+  // round caps on narrow lines look bad, and can't be
+  // stroke-adjusted, so use projecting caps instead (but we can't do
+  // this if there are zero-length dashes or segments, because those
+  // turn into round dots)
+  lineCap = state->lineCap;
+  lineJoin = state->lineJoin;
+  if (state->strokeAdjust == splashStrokeAdjustCAD &&
+      w2 < 3.5) {
+    if (lineCap == splashLineCapRound &&
+	!state->lineDashContainsZeroLengthDashes() &&
+	!path->containsZeroLengthSubpaths()) {
+      lineCap = splashLineCapProjecting;
+    }
+    if (lineJoin == splashLineJoinRound) {
+      lineJoin = splashLineJoinBevel;
+    }
+  }
+
   // if there is a min line width set, and the transformed line width
   // is smaller, use the min line width
   if (w > 0 && w2 < minLineWidth) {
-    strokeWide(path2, minLineWidth / w);
+    strokeWide(path2, minLineWidth / w, splashLineCapButt, splashLineJoinBevel);
   } else if (bitmap->mode == splashModeMono1) {
     // in monochrome mode, use 0-width lines for any transformed line
     // width <= 1 -- lines less than 1 pixel wide look too fat without
@@ -2352,7 +2456,7 @@
     if (w2 < 1.001) {
       strokeNarrow(path2);
     } else {
-      strokeWide(path2, state->lineWidth);
+      strokeWide(path2, state->lineWidth, lineCap, lineJoin);
     }
   } else {
     // in gray and color modes, only use 0-width lines if the line
@@ -2360,7 +2464,7 @@
     if (state->lineWidth == 0) {
       strokeNarrow(path2);
     } else {
-      strokeWide(path2, state->lineWidth);
+      strokeWide(path2, state->lineWidth, lineCap, lineJoin);
     }
   }
 
@@ -2380,7 +2484,9 @@
 
   nClipRes[0] = nClipRes[1] = nClipRes[2] = 0;
 
-  xPath = new SplashXPath(path, state->matrix, state->flatness, gFalse);
+  xPath = new SplashXPath(path, state->matrix, state->flatness, gFalse,
+			  state->enablePathSimplification,
+			  state->strokeAdjust);
 
   pipeInit(&pipe, state->strokePattern,
 	   (Guchar)splashRound(state->strokeAlpha * 255),
@@ -2497,10 +2603,11 @@
   (this->*pipe->run)(pipe, x0, x1, y, scanBuf + x0, NULL);
 }
 
-void Splash::strokeWide(SplashPath *path, SplashCoord w) {
+void Splash::strokeWide(SplashPath *path, SplashCoord w,
+			int lineCap, int lineJoin) {
   SplashPath *path2;
 
-  path2 = makeStrokePath(path, w, gFalse);
+  path2 = makeStrokePath(path, w, lineCap, lineJoin, gFalse);
   fillWithPattern(path2, gFalse, state->strokePattern, state->strokeAlpha);
   delete path2;
 }
@@ -2636,8 +2743,8 @@
   SplashCoord lineDashTotal;
   SplashCoord lineDashStartPhase, lineDashDist, segLen;
   SplashCoord x0, y0, x1, y1, xa, ya;
-  GBool lineDashStartOn, lineDashOn, newPath;
-  int lineDashStartIdx, lineDashIdx;
+  GBool lineDashStartOn, lineDashEndOn, lineDashOn, newPath;
+  int lineDashStartIdx, lineDashIdx, subpathStart, nDashes;
   int i, j, k;
 
   lineDashTotal = 0;
@@ -2649,6 +2756,13 @@
     return new SplashPath();
   }
   lineDashStartPhase = state->lineDashPhase;
+  if (lineDashStartPhase > lineDashTotal * 2) {
+    i = splashFloor(lineDashStartPhase / (lineDashTotal * 2));
+    lineDashStartPhase -= lineDashTotal * i * 2;
+  } else if (lineDashStartPhase < 0) {
+    i = splashCeil(-lineDashStartPhase / (lineDashTotal * 2));
+    lineDashStartPhase += lineDashTotal * i * 2;
+  }
   i = splashFloor(lineDashStartPhase / lineDashTotal);
   lineDashStartPhase -= (SplashCoord)i * lineDashTotal;
   lineDashStartOn = gTrue;
@@ -2657,7 +2771,9 @@
     while (lineDashStartPhase >= state->lineDash[lineDashStartIdx]) {
       lineDashStartOn = !lineDashStartOn;
       lineDashStartPhase -= state->lineDash[lineDashStartIdx];
-      ++lineDashStartIdx;
+      if (++lineDashStartIdx == state->lineDashLength) {
+	lineDashStartIdx = 0;
+      }
     }
   }
 
@@ -2674,8 +2790,11 @@
 
     // initialize the dash parameters
     lineDashOn = lineDashStartOn;
+    lineDashEndOn = lineDashStartOn;
     lineDashIdx = lineDashStartIdx;
     lineDashDist = state->lineDash[lineDashIdx] - lineDashStartPhase;
+    subpathStart = dPath->length;
+    nDashes = 0;
 
     // process each segment of the subpath
     newPath = gTrue;
@@ -2691,12 +2810,32 @@
       // process the segment
       while (segLen > 0) {
 
-	if (lineDashDist >= segLen) {
+	// Special case for zero-length dash segments: draw a very
+	// short -- but not zero-length -- segment.  This ensures that
+	// we get the correct behavior with butt and projecting line
+	// caps.  The PS/PDF specs imply that zero-length segments are
+	// not drawn unless the line cap is round, but Acrobat and
+	// Ghostscript both draw very short segments (for butt caps)
+	// and squares (for projecting caps).
+	if (lineDashDist == 0) {
 	  if (lineDashOn) {
 	    if (newPath) {
 	      dPath->moveTo(x0, y0);
 	      newPath = gFalse;
+	      ++nDashes;
 	    }
+	    xa = x0 + ((SplashCoord)0.001 / segLen) * (x1 - x0);
+	    ya = y0 + ((SplashCoord)0.001 / segLen) * (y1 - y0);
+	    dPath->lineTo(xa, ya);
+	  }
+
+	} else if (lineDashDist >= segLen) {
+	  if (lineDashOn) {
+	    if (newPath) {
+	      dPath->moveTo(x0, y0);
+	      newPath = gFalse;
+	      ++nDashes;
+	    }
 	    dPath->lineTo(x1, y1);
 	  }
 	  lineDashDist -= segLen;
@@ -2709,6 +2848,7 @@
 	    if (newPath) {
 	      dPath->moveTo(x0, y0);
 	      newPath = gFalse;
+	      ++nDashes;
 	    }
 	    dPath->lineTo(xa, ya);
 	  }
@@ -2718,6 +2858,8 @@
 	  lineDashDist = 0;
 	}
 
+	lineDashEndOn = lineDashOn;
+
 	// get the next entry in the dash array
 	if (lineDashDist <= 0) {
 	  lineDashOn = !lineDashOn;
@@ -2729,6 +2871,31 @@
 	}
       }
     }
+
+    // in a closed subpath, where the dash pattern is "on" at both the
+    // start and end of the subpath, we need to merge the start and
+    // end to get a proper line join
+    if ((path->flags[j] & splashPathClosed) &&
+	lineDashStartOn &&
+	lineDashEndOn) {
+      if (nDashes == 1) {
+	dPath->close();
+      } else if (nDashes > 1) {
+	k = subpathStart;
+	do {
+	  ++k;
+	  dPath->lineTo(dPath->pts[k].x, dPath->pts[k].y);
+	} while (!(dPath->flags[k] & splashPathLast));
+	++k;
+	memmove(&dPath->pts[subpathStart], &dPath->pts[k],
+		(dPath->length - k) * sizeof(SplashPathPoint));
+	memmove(&dPath->flags[subpathStart], &dPath->flags[k],
+		(dPath->length - k) * sizeof(Guchar));
+	dPath->length -= k - subpathStart;
+	dPath->curSubpath -= k - subpathStart;
+      }
+    }
+
     i = j + 1;
   }
 
@@ -2750,7 +2917,7 @@
   SplashPath *path2;
   SplashXPath *xPath;
   SplashXPathScanner *scanner;
-  int xMin, yMin, xMax, yMax, x, y, t;
+  int xMin, yMin, xMax, xMin2, xMax2, yMax, y, t;
   SplashClipResult clipRes;
 
   if (path->length == 0) {
@@ -2763,7 +2930,9 @@
 
   path2 = tweakFillPath(path);
 
-  xPath = new SplashXPath(path2, state->matrix, state->flatness, gTrue);
+  xPath = new SplashXPath(path2, state->matrix, state->flatness, gTrue,
+			  state->enablePathSimplification,
+			  state->strokeAdjust);
   if (path2 != path) {
     delete path2;
   }
@@ -2806,23 +2975,25 @@
     // draw the spans
     if (vectorAntialias && !inShading) {
       for (y = yMin; y <= yMax; ++y) {
-	scanner->getSpan(scanBuf, y, xMin, xMax);
-	if (clipRes != splashClipAllInside) {
-	  state->clip->clipSpan(scanBuf, y, xMin, xMax, state->strokeAdjust);
+	scanner->getSpan(scanBuf, y, xMin, xMax, &xMin2, &xMax2);
+	if (xMin2 <= xMax2) {
+	  if (clipRes != splashClipAllInside) {
+	    state->clip->clipSpan(scanBuf, y, xMin2, xMax2,
+				  state->strokeAdjust);
+	  }
+	  (this->*pipe.run)(&pipe, xMin2, xMax2, y, scanBuf + xMin2, NULL);
 	}
-	for (x = xMin; x <= xMax; ++x) {
-	  scanBuf[x] = aaGamma[scanBuf[x]];
-	}
-	(this->*pipe.run)(&pipe, xMin, xMax, y, scanBuf + xMin, NULL);
       }
     } else {
       for (y = yMin; y <= yMax; ++y) {
-	scanner->getSpanBinary(scanBuf, y, xMin, xMax);
-	if (clipRes != splashClipAllInside) {
-	  state->clip->clipSpanBinary(scanBuf, y, xMin, xMax,
-				      state->strokeAdjust);
+	scanner->getSpanBinary(scanBuf, y, xMin, xMax, &xMin2, &xMax2);
+	if (xMin2 <= xMax2) {
+	  if (clipRes != splashClipAllInside) {
+	    state->clip->clipSpanBinary(scanBuf, y, xMin2, xMax2,
+					state->strokeAdjust);
+	  }
+	  (this->*pipe.run)(&pipe, xMin2, xMax2, y, scanBuf + xMin2, NULL);
 	}
-	(this->*pipe.run)(&pipe, xMin, xMax, y, scanBuf + xMin, NULL);
       }
     }
   }
@@ -2849,7 +3020,7 @@
   SplashCoord xx0, yy0, xx1, yy1, dx, dy, d, wx, wy, w;
   int n;
 
-  if (!state->strokeAdjust || path->hints) {
+  if (state->strokeAdjust == splashStrokeAdjustOff || path->hints) {
     return path;
   }
 
@@ -2887,7 +3058,7 @@
 	 splashAbs(path->pts[1].y - path->pts[2].y) < 0.001)))) {
     wx = state->matrix[0] + state->matrix[2];
     wy = state->matrix[1] + state->matrix[3];
-    w = sqrt(wx*wx + wy*wy);
+    w = splashSqrt(wx*wx + wy*wy);
     if (w < 0.001) {
       w = 0;
     } else {
@@ -2905,7 +3076,7 @@
     }
     dx = xx1 - xx0;
     dy = yy1 - yy0;
-    d = sqrt(dx * dx + dy * dy);
+    d = splashSqrt(dx * dx + dy * dy);
     if (d < 0.001) {
       d = 0;
     } else {
@@ -2995,6 +3166,10 @@
   } else if (y > yMax2) {
     yMax2 = y;
   }
+  // sanity-check the coordinates - xMinI/yMinI/xMaxI/yMaxI are
+  // 32-bit integers, so coords need to be < 2^31
+  SplashXPath::clampCoords(&xMin2, &yMin2);
+  SplashXPath::clampCoords(&xMax2, &yMax2);
   xMinI = splashFloor(xMin2);
   yMinI = splashFloor(yMin2);
   xMaxI = splashFloor(xMax2);
@@ -3005,77 +3180,6 @@
          splashClipAllOutside;
 }
 
-SplashError Splash::xorFill(SplashPath *path, GBool eo) {
-  SplashPipe pipe;
-  SplashXPath *xPath;
-  SplashXPathScanner *scanner;
-  int xMin, yMin, xMax, yMax, y, t;
-  SplashClipResult clipRes;
-  SplashBlendFunc origBlendFunc;
-
-  if (path->length == 0) {
-    return splashErrEmptyPath;
-  }
-  if (pathAllOutside(path)) {
-    opClipRes = splashClipAllOutside;
-    return splashOk;
-  }
-  xPath = new SplashXPath(path, state->matrix, state->flatness, gTrue);
-  xMin = xPath->getXMin();
-  yMin = xPath->getYMin();
-  xMax = xPath->getXMax();
-  yMax = xPath->getYMax();
-  if (xMin > xMax || yMin > yMax) {
-    delete xPath;
-    return splashOk;
-  }
-  scanner = new SplashXPathScanner(xPath, eo, yMin, yMax);
-
-  // check clipping
-  if ((clipRes = state->clip->testRect(xMin, yMin, xMax, yMax,
-				       state->strokeAdjust))
-      != splashClipAllOutside) {
-
-    if ((t = state->clip->getXMinI(state->strokeAdjust)) > xMin) {
-      xMin = t;
-    }
-    if ((t = state->clip->getXMaxI(state->strokeAdjust)) < xMax) {
-      xMax = t;
-    }
-    if ((t = state->clip->getYMinI(state->strokeAdjust)) > yMin) {
-      yMin = t;
-    }
-    if ((t = state->clip->getYMaxI(state->strokeAdjust)) < yMax) {
-      yMax = t;
-    }
-    if (xMin > xMax || yMin > yMax) {
-      delete scanner;
-      delete xPath;
-      return splashOk;
-    }
-
-    origBlendFunc = state->blendFunc;
-    state->blendFunc = &blendXor;
-    pipeInit(&pipe, state->fillPattern, 255, gTrue, gFalse);
-
-    // draw the spans
-    for (y = yMin; y <= yMax; ++y) {
-      scanner->getSpanBinary(scanBuf, y, xMin, xMax);
-      if (clipRes != splashClipAllInside) {
-	state->clip->clipSpanBinary(scanBuf, y, xMin, xMax,
-				    state->strokeAdjust);
-      }
-      (this->*pipe.run)(&pipe, xMin, xMax, y, scanBuf + xMin, NULL);
-    }
-    state->blendFunc = origBlendFunc;
-  }
-  opClipRes = clipRes;
-
-  delete scanner;
-  delete xPath;
-  return splashOk;
-}
-
 SplashError Splash::fillChar(SplashCoord x, SplashCoord y,
 			     int c, SplashFont *font) {
   SplashGlyphBitmap glyph;
@@ -3208,14 +3312,14 @@
 
 void Splash::getImageBounds(SplashCoord xyMin, SplashCoord xyMax,
 			    int *xyMinI, int *xyMaxI) {
-  if (state->strokeAdjust) {
-    splashStrokeAdjust(xyMin, xyMax, xyMinI, xyMaxI);
-  } else {
+  if (state->strokeAdjust == splashStrokeAdjustOff) {
     *xyMinI = splashFloor(xyMin);
     *xyMaxI = splashFloor(xyMax);
     if (*xyMaxI <= *xyMinI) {
       *xyMaxI = *xyMinI + 1;
     }
+  } else {
+    splashStrokeAdjust(xyMin, xyMax, xyMinI, xyMaxI, state->strokeAdjust);
   }
 }
 
@@ -3254,8 +3358,14 @@
   // stream-mode upscaling -- this is slower, so we only use it if the
   // upscaled mask is large (in which case clipping should remove many
   // pixels)
-  if (wSize > 2 * w && hSize > 2 * h && wSize * hSize > 1000000) {
+#if USE_FIXEDPOINT
+  if ((wSize > 2 * w && hSize > 2 * h && (int)wSize > 1000000 / (int)hSize) ||
+      (wSize >     w && hSize >     h && (int)wSize > 10000000 / (int)hSize)) {
+#else
+  if ((wSize > 2 * w && hSize > 2 * h && wSize * hSize > 1000000) ||
+      (wSize >     w && hSize >     h && wSize * hSize > 10000000)) {
     upscaleMask(src, srcData, w, h, mat, glyphMode, interpolate);
+#endif
 
   // scaling only
   } else if (mat[0] > 0 && minorAxisZero && mat[3] > 0) {
@@ -3462,10 +3572,12 @@
 	  if (y1 >= srcHeight) {
 	    y1 = srcHeight - 1;
 	  }
-	  pix0 = ((SplashCoord)1 - sx) * unscaledImage[y0 * srcWidth + x0]
-	         + sx * unscaledImage[y0 * srcWidth + x1];
-	  pix1 = ((SplashCoord)1 - sx) * unscaledImage[y1 * srcWidth + x0]
-	         + sx * unscaledImage[y1 * srcWidth + x1];
+	  pix0 = ((SplashCoord)1 - sx)
+	           * (SplashCoord)unscaledImage[y0 * srcWidth + x0]
+	         + sx * (SplashCoord)unscaledImage[y0 * srcWidth + x1];
+	  pix1 = ((SplashCoord)1 - sx)
+	           * (SplashCoord)unscaledImage[y1 * srcWidth + x0]
+	         + sx * (SplashCoord)unscaledImage[y1 * srcWidth + x1];
 	  scanBuf[x] = (Guchar)splashRound(((SplashCoord)1 - sy) * pix0
 					   + sy * pix1);
 	} else {
@@ -4041,10 +4153,10 @@
 			   int scaledWidth, int scaledHeight,
 			   SplashBitmap *dest) {
   Guchar *lineBuf;
-  Guint pix;
-  Guchar *destPtr0, *destPtr;
-  int yp, yq, xp, xq, yt, y, yStep, xt, x, xStep, xx;
-  int i, j;
+  Guchar pix;
+  Guchar *srcPtr, *destPtr;
+  int yp, yq, xp, xq, yt, y, yStep, xt, x, xStep;
+  int i;
 
   // Bresenham parameters for y scale
   yp = scaledHeight / srcHeight;
@@ -4060,7 +4172,7 @@
   // init y scale Bresenham
   yt = 0;
 
-  destPtr0 = dest->data;
+  destPtr = dest->data;
   for (y = 0; y < srcHeight; ++y) {
 
     // y scale Bresenham
@@ -4077,7 +4189,8 @@
     // init x scale Bresenham
     xt = 0;
 
-    xx = 0;
+    // generate one row
+    srcPtr = lineBuf;
     for (x = 0; x < srcWidth; ++x) {
 
       // x scale Bresenham
@@ -4089,20 +4202,20 @@
       }
 
       // compute the final pixel
-      pix = lineBuf[x] ? 255 : 0;
+      pix = *srcPtr ? 255 : 0;
+      ++srcPtr;
 
-      // store the pixel
-      for (i = 0; i < yStep; ++i) {
-	for (j = 0; j < xStep; ++j) {
-	  destPtr = destPtr0 + i * scaledWidth + xx + j;
-	  *destPtr++ = (Guchar)pix;
-	}
+      // duplicate the pixel horizontally
+      for (i = 0; i < xStep; ++i) {
+	*destPtr++ = pix;
       }
+    }
 
-      xx += xStep;
+    // duplicate the row vertically
+    for (i = 1 ; i < yStep; ++i) {
+      memcpy(destPtr, destPtr - scaledWidth, scaledWidth);
+      destPtr += scaledWidth;
     }
-
-    destPtr0 += yStep * scaledWidth;
   }
 
   gfree(lineBuf);
@@ -4149,11 +4262,11 @@
       xSrc1 = srcWidth - 1;
     }
     lineBuf0[x] = (Guchar)(int)
-                  ((xs * lineBuf0[xSrc0] +
-		    ((SplashCoord)1 - xs) * lineBuf0[xSrc1]) * 255);
+          ((xs * (int)lineBuf0[xSrc0] +
+	    ((SplashCoord)1 - xs) * (int)lineBuf0[xSrc1]) * 255);
     lineBuf1[x] = (Guchar)(int)
-                  ((xs * lineBuf1[xSrc0] +
-		    ((SplashCoord)1 - xs) * lineBuf1[xSrc1]) * 255);
+          ((xs * (int)lineBuf1[xSrc0] +
+	    ((SplashCoord)1 - xs) * (int)lineBuf1[xSrc1]) * 255);
   }
 
   destPtr = dest->data;
@@ -4193,8 +4306,8 @@
 	  xSrc1 = srcWidth - 1;
 	}
 	lineBuf1[x] = (Guchar)(int)
-	              ((xs * lineBuf1[xSrc0] +
-			((SplashCoord)1 - xs) * lineBuf1[xSrc1]) * 255);
+	              ((xs * (int)lineBuf1[xSrc0] +
+			((SplashCoord)1 - xs) * (int)lineBuf1[xSrc1]) * 255);
       }
 
       ++yBuf;
@@ -4203,8 +4316,8 @@
     // do the vertical interpolation
     for (x = 0; x < scaledWidth; ++x) {
 
-      pix = (Guchar)(int)(ys * lineBuf0[x] +
-			  ((SplashCoord)1 - ys) * lineBuf1[x]);
+      pix = (Guchar)(int)(ys * (int)lineBuf0[x] +
+			  ((SplashCoord)1 - ys) * (int)lineBuf1[x]);
 
       // store the pixel
       *destPtr++ = pix;
@@ -4329,7 +4442,13 @@
   // stream-mode upscaling -- this is slower, so we only use it if the
   // upscaled image is large (in which case clipping should remove
   // many pixels)
-  if (wSize > 2 * w && hSize > 2 * h && wSize * hSize > 1000000) {
+#if USE_FIXEDPOINT
+  if ((wSize > 2 * w && hSize > 2 * h && (int)wSize > 1000000 / (int)hSize) ||
+      (wSize >     w && hSize >     h && (int)wSize > 10000000 / (int)hSize)) {
+#else
+  if ((wSize > 2 * w && hSize > 2 * h && wSize * hSize > 1000000) ||
+      (wSize >     w && hSize >     h && wSize * hSize > 10000000)) {
+#endif
     upscaleImage(src, srcData, srcMode, nComps, srcAlpha,
 		 w, h, mat, interpolate);
 
@@ -4367,7 +4486,7 @@
     }
 
   // scaling plus horizontal flip
-  } else if (mat[0] > 0 && minorAxisZero && mat[3] > 0) {
+  } else if (mat[0] < 0 && minorAxisZero && mat[3] > 0) {
     getImageBounds(mat[0] + mat[4], mat[4], &x0, &x1);
     getImageBounds(mat[5], mat[3] + mat[5], &y0, &y1);
     clipRes = state->clip->testRect(x0, y0, x1 - 1, y1 - 1,
@@ -4384,7 +4503,7 @@
     }
     
   // scaling plus horizontal and vertical flips
-  } else if (mat[0] > 0 && minorAxisZero && mat[3] < 0) {
+  } else if (mat[0] < 0 && minorAxisZero && mat[3] < 0) {
     getImageBounds(mat[0] + mat[4], mat[4], &x0, &x1);
     getImageBounds(mat[3] + mat[5], mat[5], &y0, &y1);
     clipRes = state->clip->testRect(x0, y0, x1 - 1, y1 - 1,
@@ -4557,16 +4676,18 @@
 	  q10 = &unscaledImage[(y1 * srcWidth + x0) * nComps];
 	  q11 = &unscaledImage[(y1 * srcWidth + x1) * nComps];
 	  for (i = 0; i < nComps; ++i) {
-	    pix0 = ((SplashCoord)1 - sx) * *q00++ + sx * *q01++;
-	    pix1 = ((SplashCoord)1 - sx) * *q10++ + sx * *q11++;
+	    pix0 = ((SplashCoord)1 - sx) * (int)*q00++ + sx * (int)*q01++;
+	    pix1 = ((SplashCoord)1 - sx) * (int)*q10++ + sx * (int)*q11++;
 	    *p++ = (Guchar)splashRound(((SplashCoord)1 - sy) * pix0
 				       + sy * pix1);
 	  }
 	  if (srcAlpha) {
-	    pix0 = ((SplashCoord)1 - sx) * unscaledAlpha[y0 * srcWidth + x0]
-	           + sx * unscaledAlpha[y0 * srcWidth + x1];
-	    pix1 = ((SplashCoord)1 - sx) * unscaledAlpha[y1 * srcWidth + x0]
-	           + sx * unscaledAlpha[y1 * srcWidth + x1];
+	    pix0 = ((SplashCoord)1 - sx)
+	             * (SplashCoord)unscaledAlpha[y0 * srcWidth + x0]
+	           + sx * (SplashCoord)unscaledAlpha[y0 * srcWidth + x1];
+	    pix1 = ((SplashCoord)1 - sx)
+	             * (SplashCoord)unscaledAlpha[y1 * srcWidth + x0]
+	           + sx * (SplashCoord)unscaledAlpha[y1 * srcWidth + x1];
 	    scanBuf[x] = (Guchar)splashRound(((SplashCoord)1 - sy) * pix0
 					     + sy * pix1);
 	  } else {
@@ -5139,6 +5260,12 @@
     alphaPixBuf = NULL;
   }
 
+  // make gcc happy
+  pix[0] = pix[1] = pix[2] = 0;
+#if SPLASH_CMYK
+  pix[3] = 0;
+#endif
+
   // init y scale Bresenham
   yt = 0;
 
@@ -5266,6 +5393,12 @@
     alphaLineBuf = NULL;
   }
 
+  // make gcc happy
+  pix[0] = pix[1] = pix[2] = 0;
+#if SPLASH_CMYK
+  pix[3] = 0;
+#endif
+
   // init y scale Bresenham
   yt = 0;
 
@@ -5380,11 +5513,15 @@
 			    int scaledWidth, int scaledHeight,
 			    SplashBitmap *dest) {
   Guchar *lineBuf, *alphaLineBuf;
-  Guint pix[splashMaxColorComps];
+  Guchar pix0, pix1, pix2;
+#if SPLASH_CMYK
+  Guchar pix3;
+#endif
   Guint alpha;
-  Guchar *destPtr0, *destPtr, *destAlphaPtr0, *destAlphaPtr;
-  int yp, yq, xp, xq, yt, y, yStep, xt, x, xStep, xx;
-  int i, j;
+  Guchar *srcPtr, *srcAlphaPtr;
+  Guchar *destPtr, *destAlphaPtr;
+  int yp, yq, xp, xq, yt, y, yStep, xt, x, xStep;
+  int i;
 
   // Bresenham parameters for y scale
   yp = scaledHeight / srcHeight;
@@ -5405,8 +5542,8 @@
   // init y scale Bresenham
   yt = 0;
 
-  destPtr0 = dest->data;
-  destAlphaPtr0 = dest->alpha;
+  destPtr = dest->data;
+  destAlphaPtr = dest->alpha;
   for (y = 0; y < srcHeight; ++y) {
 
     // y scale Bresenham
@@ -5423,7 +5560,9 @@
     // init x scale Bresenham
     xt = 0;
 
-    xx = 0;
+    // generate one row
+    srcPtr = lineBuf;
+    srcAlphaPtr = alphaLineBuf;
     for (x = 0; x < srcWidth; ++x) {
 
       // x scale Bresenham
@@ -5434,41 +5573,35 @@
 	xStep = xp;
       }
 
-      // compute the final pixel
-      for (i = 0; i < nComps; ++i) {
-	pix[i] = lineBuf[x * nComps + i];
-      }
-
-      // store the pixel
+      // duplicate the pixel horizontally
       switch (srcMode) {
       case splashModeMono8:
-	for (i = 0; i < yStep; ++i) {
-	  for (j = 0; j < xStep; ++j) {
-	    destPtr = destPtr0 + (i * scaledWidth + xx + j) * nComps;
-	    *destPtr++ = (Guchar)pix[0];
-	  }
+	pix0 = *srcPtr++;
+	for (i = 0; i < xStep; ++i) {
+	  *destPtr++ = pix0;
 	}
 	break;
       case splashModeRGB8:
-	for (i = 0; i < yStep; ++i) {
-	  for (j = 0; j < xStep; ++j) {
-	    destPtr = destPtr0 + (i * scaledWidth + xx + j) * nComps;
-	    *destPtr++ = (Guchar)pix[0];
-	    *destPtr++ = (Guchar)pix[1];
-	    *destPtr++ = (Guchar)pix[2];
-	  }
+	pix0 = *srcPtr++;
+	pix1 = *srcPtr++;
+	pix2 = *srcPtr++;
+	for (i = 0; i < xStep; ++i) {
+	  *destPtr++ = pix0;
+	  *destPtr++ = pix1;
+	  *destPtr++ = pix2;
 	}
 	break;
 #if SPLASH_CMYK
       case splashModeCMYK8:
-	for (i = 0; i < yStep; ++i) {
-	  for (j = 0; j < xStep; ++j) {
-	    destPtr = destPtr0 + (i * scaledWidth + xx + j) * nComps;
-	    *destPtr++ = (Guchar)pix[0];
-	    *destPtr++ = (Guchar)pix[1];
-	    *destPtr++ = (Guchar)pix[2];
-	    *destPtr++ = (Guchar)pix[3];
-	  }
+	pix0 = *srcPtr++;
+	pix1 = *srcPtr++;
+	pix2 = *srcPtr++;
+	pix3 = *srcPtr++;
+	for (i = 0; i < xStep; ++i) {
+	  *destPtr++ = pix0;
+	  *destPtr++ = pix1;
+	  *destPtr++ = pix2;
+	  *destPtr++ = pix3;
 	}
 	break;
 #endif
@@ -5478,23 +5611,26 @@
 	break;
       }
 
-      // process alpha
+      // duplicate the alpha value horizontally
       if (srcAlpha) {
-	alpha = alphaLineBuf[x];
-	for (i = 0; i < yStep; ++i) {
-	  for (j = 0; j < xStep; ++j) {
-	    destAlphaPtr = destAlphaPtr0 + i * scaledWidth + xx + j;
-	    *destAlphaPtr = (Guchar)alpha;
-	  }
+	alpha = *srcAlphaPtr++;
+	for (i = 0; i < xStep; ++i) {
+	  *destAlphaPtr++ = alpha;
 	}
       }
+    }
 
-      xx += xStep;
+    // duplicate the row vertically
+    for (i = 1; i < yStep; ++i) {
+      memcpy(destPtr, destPtr - scaledWidth * nComps,
+	     scaledWidth * nComps);
+      destPtr += scaledWidth * nComps;
     }
-
-    destPtr0 += yStep * scaledWidth * nComps;
     if (srcAlpha) {
-      destAlphaPtr0 += yStep * scaledWidth;
+      for (i = 1; i < yStep; ++i) {
+	memcpy(destAlphaPtr, destAlphaPtr - scaledWidth, scaledWidth);
+	destAlphaPtr += scaledWidth;
+      }
     }
   }
 
@@ -5555,22 +5691,28 @@
     }
     for (i = 0; i < nComps; ++i) {
       lineBuf0[x*nComps+i] = (Guchar)(int)
-	                     (xs * lineBuf0[xSrc0*nComps+i] +
-			      ((SplashCoord)1 - xs) * lineBuf0[xSrc1*nComps+i]);
+	    (xs * (int)lineBuf0[xSrc0*nComps+i] +
+	     ((SplashCoord)1 - xs) * (int)lineBuf0[xSrc1*nComps+i]);
       lineBuf1[x*nComps+i] = (Guchar)(int)
-	                     (xs * lineBuf1[xSrc0*nComps+i] +
-			      ((SplashCoord)1 - xs) * lineBuf1[xSrc1*nComps+i]);
+	    (xs * (int)lineBuf1[xSrc0*nComps+i] +
+	     ((SplashCoord)1 - xs) * (int)lineBuf1[xSrc1*nComps+i]);
     }
     if (srcAlpha) {
       alphaLineBuf0[x] = (Guchar)(int)
-	                 (xs * alphaLineBuf0[xSrc0] +
-			  ((SplashCoord)1 - xs) * alphaLineBuf0[xSrc1]);
+	    (xs * (int)alphaLineBuf0[xSrc0] +
+	     ((SplashCoord)1 - xs) * (int)alphaLineBuf0[xSrc1]);
       alphaLineBuf1[x] = (Guchar)(int)
-	                 (xs * alphaLineBuf1[xSrc0] +
-			  ((SplashCoord)1 - xs) * alphaLineBuf1[xSrc1]);
+	    (xs * (int)alphaLineBuf1[xSrc0] +
+	     ((SplashCoord)1 - xs) * (int)alphaLineBuf1[xSrc1]);
     }
   }
 
+  // make gcc happy
+  pix[0] = pix[1] = pix[2] = 0;
+#if SPLASH_CMYK
+  pix[3] = 0;
+#endif
+
   destPtr = dest->data;
   destAlphaPtr = dest->alpha;
   for (y = 0; y < scaledHeight; ++y) {
@@ -5612,14 +5754,14 @@
 	  xSrc1 = srcWidth - 1;
 	}
 	for (i = 0; i < nComps; ++i) {
-	  lineBuf1[x*nComps+i] =
-	        (Guchar)(int)(xs * lineBuf1[xSrc0*nComps+i] +
-			      ((SplashCoord)1 - xs) * lineBuf1[xSrc1*nComps+i]);
+	  lineBuf1[x*nComps+i] = (Guchar)(int)
+	        (xs * (int)lineBuf1[xSrc0*nComps+i] +
+		 ((SplashCoord)1 - xs) * (int)lineBuf1[xSrc1*nComps+i]);
 	}
 	if (srcAlpha) {
-	  alphaLineBuf1[x] =
-	        (Guchar)(int)(xs * alphaLineBuf1[xSrc0] +
-			      ((SplashCoord)1 - xs) * alphaLineBuf1[xSrc1]);
+	  alphaLineBuf1[x] = (Guchar)(int)
+	        (xs * (int)alphaLineBuf1[xSrc0] +
+		 ((SplashCoord)1 - xs) * (int)alphaLineBuf1[xSrc1]);
 	}
       }
 
@@ -5630,8 +5772,9 @@
     for (x = 0; x < scaledWidth; ++x) {
 
       for (i = 0; i < nComps; ++i) {
-	pix[i] = (Guchar)(int)(ys * lineBuf0[x*nComps+i] +
-			       ((SplashCoord)1 - ys) * lineBuf1[x*nComps+i]);
+	pix[i] = (Guchar)(int)
+	         (ys * (int)lineBuf0[x*nComps+i] +
+		  ((SplashCoord)1 - ys) * (int)lineBuf1[x*nComps+i]);
       }
 
       // store the pixel
@@ -5661,8 +5804,8 @@
       // process alpha
       if (srcAlpha) {
 	*destAlphaPtr++ = (Guchar)(int)
-	                  (ys * alphaLineBuf0[x] +
-			   ((SplashCoord)1 - ys) * alphaLineBuf1[x]);
+	                  (ys * (int)alphaLineBuf0[x] +
+			   ((SplashCoord)1 - ys) * (int)alphaLineBuf1[x]);
       }
     }
   }
@@ -5878,9 +6021,13 @@
 			      int xDest, int yDest, int w, int h,
 			      GBool noClip, GBool nonIsolated) {
   SplashPipe pipe;
-  int x0, x1, y0, y1, y, t;
+  Guchar *mono1Ptr, *lineBuf, *linePtr;
+  Guchar mono1Mask, b;
+  int x0, x1, x, y0, y1, y, t;
 
-  if (src->mode != bitmap->mode) {
+  if (!(src->mode == bitmap->mode ||
+	(src->mode == splashModeMono8 && bitmap->mode == splashModeMono1) ||
+	(src->mode == splashModeRGB8 && bitmap->mode == splashModeBGR8))) {
     return splashErrModeMismatch;
   }
 
@@ -5887,76 +6034,277 @@
   pipeInit(&pipe, NULL,
 	   (Guchar)splashRound(state->fillAlpha * 255),
 	   !noClip || src->alpha != NULL, nonIsolated);
-  if (noClip) {
-    if (src->alpha) {
-      for (y = 0; y < h; ++y) {
-	// this uses shape instead of alpha, which isn't technically
-	// correct, but works out the same
-	(this->*pipe.run)(&pipe, xDest, xDest + w - 1, yDest + y,
-			  src->getAlphaPtr() +
-			    (ySrc + y) * src->getWidth() + xSrc,
-			  src->getDataPtr() + (ySrc + y) * src->getRowSize() +
-			    xSrc * bitmapComps);
+  if (src->mode == splashModeMono1) {
+    // in mono1 mode, pipeRun expects the source to be in mono8
+    // format, so we need to extract the source color values into
+    // scanBuf, expanding them from mono1 to mono8
+    if (noClip) {
+      if (src->alpha) {
+	for (y = 0; y < h; ++y) {
+	  mono1Ptr = src->getDataPtr()
+	             + (ySrc + y) * src->rowSize + (xSrc >> 3);
+	  mono1Mask = 0x80 >> (xSrc & 7);
+	  for (x = 0; x < w; ++x) {
+	    scanBuf[x] = (*mono1Ptr & mono1Mask) ? 0xff : 0x00;
+	    mono1Ptr += mono1Mask & 1;
+	    mono1Mask = (mono1Mask << 7) | (mono1Mask >> 1);
+	  }
+	  // this uses shape instead of alpha, which isn't technically
+	  // correct, but works out the same
+	  (this->*pipe.run)(&pipe, xDest, xDest + w - 1, yDest + y,
+			    src->getAlphaPtr() +
+			      (ySrc + y) * src->getWidth() + xSrc,
+			    scanBuf);
+	}
+      } else {
+	for (y = 0; y < h; ++y) {
+	  mono1Ptr = src->getDataPtr()
+	             + (ySrc + y) * src->rowSize + (xSrc >> 3);
+	  mono1Mask = 0x80 >> (xSrc & 7);
+	  for (x = 0; x < w; ++x) {
+	    scanBuf[x] = (*mono1Ptr & mono1Mask) ? 0xff : 0x00;
+	    mono1Ptr += mono1Mask & 1;
+	    mono1Mask = (mono1Mask << 7) | (mono1Mask >> 1);
+	  }
+	  (this->*pipe.run)(&pipe, xDest, xDest + w - 1, yDest + y,
+			    NULL,
+			    scanBuf);
+	}
       }
     } else {
-      for (y = 0; y < h; ++y) {
-	(this->*pipe.run)(&pipe, xDest, xDest + w - 1, yDest + y,
-			  NULL,
-			  src->getDataPtr() + (ySrc + y) * src->getRowSize() +
-			    xSrc * bitmapComps);
+      x0 = xDest;
+      if ((t = state->clip->getXMinI(state->strokeAdjust)) > x0) {
+	x0 = t;
       }
+      x1 = xDest + w;
+      if ((t = state->clip->getXMaxI(state->strokeAdjust) + 1) < x1) {
+	x1 = t;
+      }
+      y0 = yDest;
+      if ((t = state->clip->getYMinI(state->strokeAdjust)) > y0) {
+	y0 = t;
+      }
+      y1 = yDest + h;
+      if ((t = state->clip->getYMaxI(state->strokeAdjust) + 1) < y1) {
+	y1 = t;
+      }
+      if (x0 < x1 && y0 < y1) {
+	if (src->alpha) {
+	  for (y = y0; y < y1; ++y) {
+	    mono1Ptr = src->getDataPtr()
+	               + (ySrc + y - yDest) * src->rowSize
+	               + ((xSrc + x0 - xDest) >> 3);
+	    mono1Mask = 0x80 >> ((xSrc + x0 - xDest) & 7);
+	    for (x = x0; x < x1; ++x) {
+	      scanBuf[x] = (*mono1Ptr & mono1Mask) ? 0xff : 0x00;
+	      mono1Ptr += mono1Mask & 1;
+	      mono1Mask = (mono1Mask << 7) | (mono1Mask >> 1);
+	    }
+	    memcpy(scanBuf2 + x0,
+		   src->getAlphaPtr() + (ySrc + y - yDest) * src->getWidth() + 
+		     (xSrc + x0 - xDest),
+		   x1 - x0);
+	    if (!state->clip->clipSpanBinary(scanBuf2, y, x0, x1 - 1,
+					     state->strokeAdjust)) {
+	      continue;
+	    }
+	    // this uses shape instead of alpha, which isn't technically
+	    // correct, but works out the same
+	    (this->*pipe.run)(&pipe, x0, x1 - 1, y,
+			      scanBuf2 + x0,
+			      scanBuf + x0);
+	  }
+	} else {
+	  for (y = y0; y < y1; ++y) {
+	    mono1Ptr = src->getDataPtr()
+	               + (ySrc + y - yDest) * src->rowSize
+	               + ((xSrc + x0 - xDest) >> 3);
+	    mono1Mask = 0x80 >> ((xSrc + x0 - xDest) & 7);
+	    for (x = x0; x < x1; ++x) {
+	      scanBuf[x] = (*mono1Ptr & mono1Mask) ? 0xff : 0x00;
+	      mono1Ptr += mono1Mask & 1;
+	      mono1Mask = (mono1Mask << 7) | (mono1Mask >> 1);
+	    }
+	    memset(scanBuf2 + x0, 0xff, x1 - x0);
+	    if (!state->clip->clipSpanBinary(scanBuf2, y, x0, x1 - 1,
+					     state->strokeAdjust)) {
+	      continue;
+	    }
+	    (this->*pipe.run)(&pipe, x0, x1 - 1, y,
+			      scanBuf2 + x0,
+			      scanBuf + x0);
+	  }
+	}
+      }
     }
-  } else {
-    x0 = xDest;
-    if ((t = state->clip->getXMinI(state->strokeAdjust)) > x0) {
-      x0 = t;
-    }
-    x1 = xDest + w;
-    if ((t = state->clip->getXMaxI(state->strokeAdjust) + 1) < x1) {
-      x1 = t;
-    }
-    y0 = yDest;
-    if ((t = state->clip->getYMinI(state->strokeAdjust)) > y0) {
-      y0 = t;
-    }
-    y1 = yDest + h;
-    if ((t = state->clip->getYMaxI(state->strokeAdjust) + 1) < y1) {
-      y1 = t;
-    }
-    if (x0 < x1 && y0 < y1) {
+
+  } else if (src->mode == splashModeBGR8) {
+    // in BGR8 mode, pipeRun expects the source to be in RGB8 format,
+    // so we need to swap bytes
+    lineBuf = (Guchar *)gmallocn(w, 3);
+    if (noClip) {
       if (src->alpha) {
-	for (y = y0; y < y1; ++y) {
-	  memcpy(scanBuf + x0,
-		 src->getAlphaPtr() + (ySrc + y - yDest) * src->getWidth() + 
-		   (xSrc + x0 - xDest),
-		 x1 - x0);
-	  if (!state->clip->clipSpanBinary(scanBuf, y, x0, x1 - 1,
-					   state->strokeAdjust)) {
-	    continue;
+	for (y = 0; y < h; ++y) {
+	  memcpy(lineBuf,
+		 src->getDataPtr() + (ySrc + y) * src->rowSize + xSrc * 3,
+		 w * 3);
+	  for (x = 0, linePtr = lineBuf; x < w; ++x, linePtr += 3) {
+	    b = linePtr[0];
+	    linePtr[0] = linePtr[2];
+	    linePtr[2] = b;
 	  }
 	  // this uses shape instead of alpha, which isn't technically
 	  // correct, but works out the same
-	  (this->*pipe.run)(&pipe, x0, x1 - 1, y,
-			    scanBuf + x0,
-			    src->getDataPtr() +
-			      (ySrc + y - yDest) * src->getRowSize() +
-			      (xSrc + x0 - xDest) * bitmapComps);
+	  (this->*pipe.run)(&pipe, xDest, xDest + w - 1, yDest + y,
+			    src->getAlphaPtr() +
+			      (ySrc + y) * src->getWidth() + xSrc,
+			    lineBuf);
 	}
       } else {
-	for (y = y0; y < y1; ++y) {
-	  memset(scanBuf + x0, 0xff, x1 - x0);
-	  if (!state->clip->clipSpanBinary(scanBuf, y, x0, x1 - 1,
-					   state->strokeAdjust)) {
-	    continue;
+	for (y = 0; y < h; ++y) {
+	  memcpy(lineBuf,
+		 src->getDataPtr() + (ySrc + y) * src->rowSize + xSrc * 3,
+		 w * 3);
+	  for (x = 0, linePtr = lineBuf; x < w; ++x, linePtr += 3) {
+	    b = linePtr[0];
+	    linePtr[0] = linePtr[2];
+	    linePtr[2] = b;
 	  }
 	  (this->*pipe.run)(&pipe, xDest, xDest + w - 1, yDest + y,
-			    scanBuf + x0,
-			    src->getDataPtr() +
-			      (ySrc + y - yDest) * src->getRowSize() +
-			      (xSrc - xDest) * bitmapComps);
+			    NULL, lineBuf);
 	}
       }
+    } else {
+      x0 = xDest;
+      if ((t = state->clip->getXMinI(state->strokeAdjust)) > x0) {
+	x0 = t;
+      }
+      x1 = xDest + w;
+      if ((t = state->clip->getXMaxI(state->strokeAdjust) + 1) < x1) {
+	x1 = t;
+      }
+      y0 = yDest;
+      if ((t = state->clip->getYMinI(state->strokeAdjust)) > y0) {
+	y0 = t;
+      }
+      y1 = yDest + h;
+      if ((t = state->clip->getYMaxI(state->strokeAdjust) + 1) < y1) {
+	y1 = t;
+      }
+      if (x0 < x1 && y0 < y1) {
+	if (src->alpha) {
+	  for (y = y0; y < y1; ++y) {
+	    memcpy(scanBuf + x0,
+		   src->getAlphaPtr() + (ySrc + y - yDest) * src->getWidth() + 
+		     (xSrc + x0 - xDest),
+		   x1 - x0);
+	    state->clip->clipSpan(scanBuf, y, x0, x1 - 1, state->strokeAdjust);
+	    memcpy(lineBuf,
+		   src->getDataPtr() +
+		     (ySrc + y - yDest) * src->rowSize +
+		     (xSrc + x0 - xDest) * 3,
+		   (x1 - x0) * 3);
+	    for (x = 0, linePtr = lineBuf; x < x1 - x0; ++x, linePtr += 3) {
+	      b = linePtr[0];
+	      linePtr[0] = linePtr[2];
+	      linePtr[2] = b;
+	    }
+	    // this uses shape instead of alpha, which isn't technically
+	    // correct, but works out the same
+	    (this->*pipe.run)(&pipe, x0, x1 - 1, y,
+			      scanBuf + x0, lineBuf);
+	  }
+	} else {
+	  for (y = y0; y < y1; ++y) {
+	    memset(scanBuf + x0, 0xff, x1 - x0);
+	    state->clip->clipSpan(scanBuf, y, x0, x1 - 1, state->strokeAdjust);
+	    memcpy(lineBuf,
+		   src->getDataPtr() +
+		     (ySrc + y - yDest) * src->rowSize +
+		     (xSrc + x0 - xDest) * 3,
+		   (x1 - x0) * 3);
+	    for (x = 0, linePtr = lineBuf; x < x1 - x0; ++x, linePtr += 3) {
+	      b = linePtr[0];
+	      linePtr[0] = linePtr[2];
+	      linePtr[2] = b;
+	    }
+	    (this->*pipe.run)(&pipe, x0, x1 - 1, yDest + y,
+			      scanBuf + x0,
+			      src->getDataPtr() +
+			        (ySrc + y - yDest) * src->rowSize +
+			        (xSrc + x0 - xDest) * bitmapComps);
+	  }
+	}
+      }
     }
+    gfree(lineBuf);
+
+  } else { // src->mode not mono1 or BGR8
+    if (noClip) {
+      if (src->alpha) {
+	for (y = 0; y < h; ++y) {
+	  // this uses shape instead of alpha, which isn't technically
+	  // correct, but works out the same
+	  (this->*pipe.run)(&pipe, xDest, xDest + w - 1, yDest + y,
+			    src->getAlphaPtr() +
+			      (ySrc + y) * src->getWidth() + xSrc,
+			    src->getDataPtr() + (ySrc + y) * src->rowSize +
+			      xSrc * bitmapComps);
+	}
+      } else {
+	for (y = 0; y < h; ++y) {
+	  (this->*pipe.run)(&pipe, xDest, xDest + w - 1, yDest + y,
+			    NULL,
+			    src->getDataPtr() + (ySrc + y) * src->rowSize +
+			      xSrc * bitmapComps);
+	}
+      }
+    } else {
+      x0 = xDest;
+      if ((t = state->clip->getXMinI(state->strokeAdjust)) > x0) {
+	x0 = t;
+      }
+      x1 = xDest + w;
+      if ((t = state->clip->getXMaxI(state->strokeAdjust) + 1) < x1) {
+	x1 = t;
+      }
+      y0 = yDest;
+      if ((t = state->clip->getYMinI(state->strokeAdjust)) > y0) {
+	y0 = t;
+      }
+      y1 = yDest + h;
+      if ((t = state->clip->getYMaxI(state->strokeAdjust) + 1) < y1) {
+	y1 = t;
+      }
+      if (x0 < x1 && y0 < y1) {
+	if (src->alpha) {
+	  for (y = y0; y < y1; ++y) {
+	    memcpy(scanBuf + x0,
+		   src->getAlphaPtr() + (ySrc + y - yDest) * src->getWidth() + 
+		     (xSrc + x0 - xDest),
+		   x1 - x0);
+	    state->clip->clipSpan(scanBuf, y, x0, x1 - 1, state->strokeAdjust);
+	    // this uses shape instead of alpha, which isn't technically
+	    // correct, but works out the same
+	    (this->*pipe.run)(&pipe, x0, x1 - 1, y,
+			      scanBuf + x0,
+			      src->getDataPtr() +
+			        (ySrc + y - yDest) * src->rowSize +
+			        (xSrc + x0 - xDest) * bitmapComps);
+	  }
+	} else {
+	  for (y = y0; y < y1; ++y) {
+	    memset(scanBuf + x0, 0xff, x1 - x0);
+	    state->clip->clipSpan(scanBuf, y, x0, x1 - 1, state->strokeAdjust);
+	    (this->*pipe.run)(&pipe, x0, x1 - 1, yDest + y,
+			      scanBuf + x0,
+			      src->getDataPtr() +
+			        (ySrc + y - yDest) * src->rowSize +
+			        (xSrc + x0 - xDest) * bitmapComps);
+	  }
+	}
+      }
+    }
   }
 
   return splashOk;
@@ -5980,13 +6328,21 @@
       mask = 0x80;
       for (x = 0; x < bitmap->width; ++x) {
 	alpha = *q++;
-	alpha1 = 255 - alpha;
-	c = (*p & mask) ? 0xff : 0x00;
-	c = div255(alpha1 * color0 + alpha * c);
-	if (c & 0x80) {
-	  *p |= mask;
-	} else {
-	  *p &= ~mask;
+	if (alpha == 0) {
+	  if (color0 & 0x80) {
+	    *p |= mask;
+	  } else {
+	    *p &= ~mask;
+	  }
+	} else if (alpha != 255) {
+	  alpha1 = 255 - alpha;
+	  c = (*p & mask) ? 0xff : 0x00;
+	  c = div255(alpha1 * color0 + alpha * c);
+	  if (c & 0x80) {
+	    *p |= mask;
+	  } else {
+	    *p &= ~mask;
+	  }
 	}
 	if (!(mask >>= 1)) {
 	  mask = 0x80;
@@ -6002,8 +6358,12 @@
       q = &bitmap->alpha[y * bitmap->width];
       for (x = 0; x < bitmap->width; ++x) {
 	alpha = *q++;
-	alpha1 = 255 - alpha;
-	p[0] = div255(alpha1 * color0 + alpha * p[0]);
+	if (alpha == 0) {
+	  p[0] = color0;
+	} else if (alpha != 255) {
+	  alpha1 = 255 - alpha;
+	  p[0] = div255(alpha1 * color0 + alpha * p[0]);
+	}
 	++p;
       }
     }
@@ -6018,10 +6378,16 @@
       q = &bitmap->alpha[y * bitmap->width];
       for (x = 0; x < bitmap->width; ++x) {
 	alpha = *q++;
-	alpha1 = 255 - alpha;
-	p[0] = div255(alpha1 * color0 + alpha * p[0]);
-	p[1] = div255(alpha1 * color1 + alpha * p[1]);
-	p[2] = div255(alpha1 * color2 + alpha * p[2]);
+	if (alpha == 0) {
+	  p[0] = color0;
+	  p[1] = color1;
+	  p[2] = color2;
+	} else if (alpha != 255) {
+	  alpha1 = 255 - alpha;
+	  p[0] = div255(alpha1 * color0 + alpha * p[0]);
+	  p[1] = div255(alpha1 * color1 + alpha * p[1]);
+	  p[2] = div255(alpha1 * color2 + alpha * p[2]);
+	}
 	p += 3;
       }
     }
@@ -6037,11 +6403,18 @@
       q = &bitmap->alpha[y * bitmap->width];
       for (x = 0; x < bitmap->width; ++x) {
 	alpha = *q++;
-	alpha1 = 255 - alpha;
-	p[0] = div255(alpha1 * color0 + alpha * p[0]);
-	p[1] = div255(alpha1 * color1 + alpha * p[1]);
-	p[2] = div255(alpha1 * color2 + alpha * p[2]);
-	p[3] = div255(alpha1 * color3 + alpha * p[3]);
+	if (alpha == 0) {
+	  p[0] = color0;
+	  p[1] = color1;
+	  p[2] = color2;
+	  p[3] = color3;
+	} else if (alpha != 255) {
+	  alpha1 = 255 - alpha;
+	  p[0] = div255(alpha1 * color0 + alpha * p[0]);
+	  p[1] = div255(alpha1 * color1 + alpha * p[1]);
+	  p[2] = div255(alpha1 * color2 + alpha * p[2]);
+	  p[3] = div255(alpha1 * color3 + alpha * p[3]);
+	}
 	p += 4;
       }
     }
@@ -6120,11 +6493,95 @@
   return splashOk;
 }
 
+SplashError Splash::blitCorrectedAlpha(SplashBitmap *dest, int xSrc, int ySrc,
+				       int xDest, int yDest, int w, int h) {
+  SplashColorPtr p, q;
+  Guchar *alpha0Ptr;
+  Guchar alpha0, aSrc;
+  int x, y, mask, srcMask;
+
+  if (bitmap->mode != dest->mode ||
+      !bitmap->alpha ||
+      !dest->alpha ||
+      !groupBackBitmap) {
+    return splashErrModeMismatch;
+  }
+
+  switch (bitmap->mode) {
+  case splashModeMono1:
+    for (y = 0; y < h; ++y) {
+      p = &dest->data[(yDest + y) * dest->rowSize + (xDest >> 3)];
+      mask = 0x80 >> (xDest & 7);
+      q = &bitmap->data[(ySrc + y) * bitmap->rowSize + (xSrc >> 3)];
+      srcMask = 0x80 >> (xSrc & 7);
+      for (x = 0; x < w; ++x) {
+	if (*q & srcMask) {
+	  *p |= mask;
+	} else {
+	  *p &= ~mask;
+	}
+	if (!(mask >>= 1)) {
+	  mask = 0x80;
+	  ++p;
+	}
+	if (!(srcMask >>= 1)) {
+	  srcMask = 0x80;
+	  ++q;
+	}
+      }
+    }
+    break;
+  case splashModeMono8:
+    for (y = 0; y < h; ++y) {
+      p = &dest->data[(yDest + y) * dest->rowSize + xDest];
+      q = &bitmap->data[(ySrc + y) * bitmap->rowSize + xSrc];
+      memcpy(p, q, w);
+    }
+    break;
+  case splashModeRGB8:
+  case splashModeBGR8:
+    for (y = 0; y < h; ++y) {
+      p = &dest->data[(yDest + y) * dest->rowSize + 3 * xDest];
+      q = &bitmap->data[(ySrc + y) * bitmap->rowSize + 3 * xSrc];
+      memcpy(p, q, 3 * w);
+    }
+    break;
+#if SPLASH_CMYK
+  case splashModeCMYK8:
+    for (y = 0; y < h; ++y) {
+      p = &dest->data[(yDest + y) * dest->rowSize + 4 * xDest];
+      q = &bitmap->data[(ySrc + y) * bitmap->rowSize + 4 * xSrc];
+      memcpy(p, q, 4 * w);
+    }
+    break;
+#endif
+  }
+
+  for (y = 0; y < h; ++y) {
+    p = &dest->alpha[(yDest + y) * dest->width + xDest];
+    q = &bitmap->alpha[(ySrc + y) * bitmap->width + xSrc];
+    alpha0Ptr = &groupBackBitmap->alpha[(groupBackY + ySrc + y)
+					  * groupBackBitmap->width +
+					(groupBackX + xSrc)];
+    for (x = 0; x < w; ++x) {
+      alpha0 = *alpha0Ptr++;
+      aSrc = *q++;
+      *p++ = alpha0 + aSrc - div255(alpha0 * aSrc);
+    }
+  }
+
+  return splashOk;
+}
+
 SplashPath *Splash::makeStrokePath(SplashPath *path, SplashCoord w,
-				    GBool flatten) {
+				   int lineCap, int lineJoin,
+				   GBool flatten) {
   SplashPath *pathIn, *dashPath, *pathOut;
   SplashCoord d, dx, dy, wdx, wdy, dxNext, dyNext, wdxNext, wdyNext;
   SplashCoord crossprod, dotprod, miter, m;
+  SplashCoord angle, angleNext, dAngle, xc, yc;
+  SplashCoord dxJoin, dyJoin, dJoin, kappa;
+  SplashCoord cx1, cy1, cx2, cy2, cx3, cy3, cx4, cy4;
   GBool first, last, closed;
   int subpathStart0, subpathStart1, seg, i0, i1, j0, j1, k0, k1;
   int left0, left1, left2, right0, right1, right2, join0, join1, join2;
@@ -6184,7 +6641,7 @@
       j1 = j0;
     }
     if (pathIn->flags[i1] & splashPathLast) {
-      if (first && state->lineCap == splashLineCapRound) {
+      if (first && lineCap == splashLineCapRound) {
 	// special case: zero-length subpath with round line caps -->
 	// draw a circle
 	pathOut->moveTo(pathIn->pts[i0].x + (SplashCoord)0.5 * w,
@@ -6250,16 +6707,17 @@
     wdy = (SplashCoord)0.5 * w * dy;
 
     // draw the start cap
-    pathOut->moveTo(pathIn->pts[i0].x - wdy, pathIn->pts[i0].y + wdx);
     if (i0 == subpathStart0) {
-      firstPt = pathOut->length - 1;
+      firstPt = pathOut->length;
     }
     if (first && !closed) {
-      switch (state->lineCap) {
+      switch (lineCap) {
       case splashLineCapButt:
+	pathOut->moveTo(pathIn->pts[i0].x - wdy, pathIn->pts[i0].y + wdx);
 	pathOut->lineTo(pathIn->pts[i0].x + wdy, pathIn->pts[i0].y - wdx);
 	break;
       case splashLineCapRound:
+	pathOut->moveTo(pathIn->pts[i0].x - wdy, pathIn->pts[i0].y + wdx);
 	pathOut->curveTo(pathIn->pts[i0].x - wdy - bezierCircle * wdx,
 			 pathIn->pts[i0].y + wdx - bezierCircle * wdy,
 			 pathIn->pts[i0].x - wdx - bezierCircle * wdy,
@@ -6274,29 +6732,27 @@
 			 pathIn->pts[i0].y - wdx);
 	break;
       case splashLineCapProjecting:
-	pathOut->lineTo(pathIn->pts[i0].x - wdx - wdy,
+	pathOut->moveTo(pathIn->pts[i0].x - wdx - wdy,
 			pathIn->pts[i0].y + wdx - wdy);
 	pathOut->lineTo(pathIn->pts[i0].x - wdx + wdy,
 			pathIn->pts[i0].y - wdx - wdy);
-	pathOut->lineTo(pathIn->pts[i0].x + wdy,
-			pathIn->pts[i0].y - wdx);
 	break;
       }
     } else {
+      pathOut->moveTo(pathIn->pts[i0].x - wdy, pathIn->pts[i0].y + wdx);
       pathOut->lineTo(pathIn->pts[i0].x + wdy, pathIn->pts[i0].y - wdx);
     }
 
-    // draw the left side of the segment rectangle
+    // draw the left side of the segment rectangle and the end cap
     left2 = pathOut->length - 1;
-    pathOut->lineTo(pathIn->pts[j0].x + wdy, pathIn->pts[j0].y - wdx);
-
-    // draw the end cap
     if (last && !closed) {
-      switch (state->lineCap) {
+      switch (lineCap) {
       case splashLineCapButt:
+	pathOut->lineTo(pathIn->pts[j0].x + wdy, pathIn->pts[j0].y - wdx);
 	pathOut->lineTo(pathIn->pts[j0].x - wdy, pathIn->pts[j0].y + wdx);
 	break;
       case splashLineCapRound:
+	pathOut->lineTo(pathIn->pts[j0].x + wdy, pathIn->pts[j0].y - wdx);
 	pathOut->curveTo(pathIn->pts[j0].x + wdy + bezierCircle * wdx,
 			 pathIn->pts[j0].y - wdx + bezierCircle * wdy,
 			 pathIn->pts[j0].x + wdx + bezierCircle * wdy,
@@ -6315,11 +6771,10 @@
 			pathIn->pts[j0].y - wdx + wdy);
 	pathOut->lineTo(pathIn->pts[j0].x - wdy + wdx,
 			pathIn->pts[j0].y + wdx + wdy);
-	pathOut->lineTo(pathIn->pts[j0].x - wdy,
-			pathIn->pts[j0].y + wdx);
 	break;
       }
     } else {
+      pathOut->lineTo(pathIn->pts[j0].x + wdy, pathIn->pts[j0].y - wdx);
       pathOut->lineTo(pathIn->pts[j0].x - wdy, pathIn->pts[j0].y + wdx);
     }
 
@@ -6327,7 +6782,7 @@
     // (NB: if stroke adjustment is enabled, the closepath operation MUST
     // add a segment because this segment is used for a hint)
     right2 = pathOut->length - 1;
-    pathOut->close(state->strokeAdjust);
+    pathOut->close(state->strokeAdjust != splashStrokeAdjustOff);
 
     // draw the join
     join2 = pathOut->length;
@@ -6372,43 +6827,121 @@
       }
 
       // round join
-      if (state->lineJoin == splashLineJoinRound) {
-	pathOut->moveTo(pathIn->pts[j0].x + (SplashCoord)0.5 * w,
-			pathIn->pts[j0].y);
-	pathOut->curveTo(pathIn->pts[j0].x + (SplashCoord)0.5 * w,
-			 pathIn->pts[j0].y + bezierCircle2 * w,
-			 pathIn->pts[j0].x + bezierCircle2 * w,
-			 pathIn->pts[j0].y + (SplashCoord)0.5 * w,
-			 pathIn->pts[j0].x,
-			 pathIn->pts[j0].y + (SplashCoord)0.5 * w);
-	pathOut->curveTo(pathIn->pts[j0].x - bezierCircle2 * w,
-			 pathIn->pts[j0].y + (SplashCoord)0.5 * w,
-			 pathIn->pts[j0].x - (SplashCoord)0.5 * w,
-			 pathIn->pts[j0].y + bezierCircle2 * w,
-			 pathIn->pts[j0].x - (SplashCoord)0.5 * w,
-			 pathIn->pts[j0].y);
-	pathOut->curveTo(pathIn->pts[j0].x - (SplashCoord)0.5 * w,
-			 pathIn->pts[j0].y - bezierCircle2 * w,
-			 pathIn->pts[j0].x - bezierCircle2 * w,
-			 pathIn->pts[j0].y - (SplashCoord)0.5 * w,
-			 pathIn->pts[j0].x,
-			 pathIn->pts[j0].y - (SplashCoord)0.5 * w);
-	pathOut->curveTo(pathIn->pts[j0].x + bezierCircle2 * w,
-			 pathIn->pts[j0].y - (SplashCoord)0.5 * w,
-			 pathIn->pts[j0].x + (SplashCoord)0.5 * w,
-			 pathIn->pts[j0].y - bezierCircle2 * w,
-			 pathIn->pts[j0].x + (SplashCoord)0.5 * w,
-			 pathIn->pts[j0].y);
+      if (lineJoin == splashLineJoinRound) {
+	// join angle < 180
+	if (crossprod < 0) {
+	  angle = atan2((double)dx, (double)-dy);
+	  angleNext = atan2((double)dxNext, (double)-dyNext);
+	  if (angle < angleNext) {
+	    angle += 2 * M_PI;
+	  }
+	  dAngle = (angle  - angleNext) / M_PI;
+	  if (dAngle < 0.501) {
+	    // span angle is <= 90 degrees -> draw a single arc
+	    kappa = dAngle * bezierCircle * w;
+	    cx1 = pathIn->pts[j0].x - wdy + kappa * dx;
+	    cy1 = pathIn->pts[j0].y + wdx + kappa * dy;
+	    cx2 = pathIn->pts[j0].x - wdyNext - kappa * dxNext;
+	    cy2 = pathIn->pts[j0].y + wdxNext - kappa * dyNext;
+	    pathOut->moveTo(pathIn->pts[j0].x, pathIn->pts[j0].y);
+	    pathOut->lineTo(pathIn->pts[j0].x - wdyNext,
+			    pathIn->pts[j0].y + wdxNext);
+	    pathOut->curveTo(cx2, cy2, cx1, cy1,
+			     pathIn->pts[j0].x - wdy,
+			     pathIn->pts[j0].y + wdx);
+	  } else {
+	    // span angle is > 90 degrees -> split into two arcs
+	    dJoin = splashDist(-wdy, wdx, -wdyNext, wdxNext);
+	    if (dJoin > 0) {
+	      dxJoin = (-wdyNext + wdy) / dJoin;
+	      dyJoin = (wdxNext - wdx) / dJoin;
+	      xc = pathIn->pts[j0].x
+		   + (SplashCoord)0.5 * w
+		     * cos((double)((SplashCoord)0.5 * (angle + angleNext)));
+	      yc = pathIn->pts[j0].y
+		   + (SplashCoord)0.5 * w
+		     * sin((double)((SplashCoord)0.5 * (angle + angleNext)));
+	      kappa = dAngle * bezierCircle2 * w;
+	      cx1 = pathIn->pts[j0].x - wdy + kappa * dx;
+	      cy1 = pathIn->pts[j0].y + wdx + kappa * dy;
+	      cx2 = xc - kappa * dxJoin;
+	      cy2 = yc - kappa * dyJoin;
+	      cx3 = xc + kappa * dxJoin;
+	      cy3 = yc + kappa * dyJoin;
+	      cx4 = pathIn->pts[j0].x - wdyNext - kappa * dxNext;
+	      cy4 = pathIn->pts[j0].y + wdxNext - kappa * dyNext;
+	      pathOut->moveTo(pathIn->pts[j0].x, pathIn->pts[j0].y);
+	      pathOut->lineTo(pathIn->pts[j0].x - wdyNext,
+			      pathIn->pts[j0].y + wdxNext);
+	      pathOut->curveTo(cx4, cy4, cx3, cy3, xc, yc);
+	      pathOut->curveTo(cx2, cy2, cx1, cy1,
+			       pathIn->pts[j0].x - wdy,
+			       pathIn->pts[j0].y + wdx);
+	    }
+	  }
 
+	// join angle >= 180
+	} else {
+	  angle = atan2((double)-dx, (double)dy);
+	  angleNext = atan2((double)-dxNext, (double)dyNext);
+	  if (angleNext < angle) {
+	    angleNext += 2 * M_PI;
+	  }
+	  dAngle = (angleNext - angle) / M_PI;
+	  if (dAngle < 0.501) {
+	    // span angle is <= 90 degrees -> draw a single arc
+	    kappa = dAngle * bezierCircle * w;
+	      cx1 = pathIn->pts[j0].x + wdy + kappa * dx;
+	      cy1 = pathIn->pts[j0].y - wdx + kappa * dy;
+	      cx2 = pathIn->pts[j0].x + wdyNext - kappa * dxNext;
+	      cy2 = pathIn->pts[j0].y - wdxNext - kappa * dyNext;
+	      pathOut->moveTo(pathIn->pts[j0].x, pathIn->pts[j0].y);
+	      pathOut->lineTo(pathIn->pts[j0].x + wdy,
+			      pathIn->pts[j0].y - wdx);
+	      pathOut->curveTo(cx1, cy1, cx2, cy2,
+			       pathIn->pts[j0].x + wdyNext,
+			       pathIn->pts[j0].y - wdxNext);
+	  } else {
+	    // span angle is > 90 degrees -> split into two arcs
+	    dJoin = splashDist(wdy, -wdx, wdyNext, -wdxNext);
+	    if (dJoin > 0) {
+	      dxJoin = (wdyNext - wdy) / dJoin;
+	      dyJoin = (-wdxNext + wdx) / dJoin;
+	      xc = pathIn->pts[j0].x
+		   + (SplashCoord)0.5 * w
+		     * cos((double)((SplashCoord)0.5 * (angle + angleNext)));
+	      yc = pathIn->pts[j0].y
+		   + (SplashCoord)0.5 * w
+		     * sin((double)((SplashCoord)0.5 * (angle + angleNext)));
+	      kappa = dAngle * bezierCircle2 * w;
+	      cx1 = pathIn->pts[j0].x + wdy + kappa * dx;
+	      cy1 = pathIn->pts[j0].y - wdx + kappa * dy;
+	      cx2 = xc - kappa * dxJoin;
+	      cy2 = yc - kappa * dyJoin;
+	      cx3 = xc + kappa * dxJoin;
+	      cy3 = yc + kappa * dyJoin;
+	      cx4 = pathIn->pts[j0].x + wdyNext - kappa * dxNext;
+	      cy4 = pathIn->pts[j0].y - wdxNext - kappa * dyNext;
+	      pathOut->moveTo(pathIn->pts[j0].x, pathIn->pts[j0].y);
+	      pathOut->lineTo(pathIn->pts[j0].x + wdy,
+			      pathIn->pts[j0].y - wdx);
+	      pathOut->curveTo(cx1, cy1, cx2, cy2, xc, yc);
+	      pathOut->curveTo(cx3, cy3, cx4, cy4,
+			       pathIn->pts[j0].x + wdyNext,
+			       pathIn->pts[j0].y - wdxNext);
+	    }
+	  }
+	}
+
       } else {
 	pathOut->moveTo(pathIn->pts[j0].x, pathIn->pts[j0].y);
 
-	// angle < 180
+	// join angle < 180
 	if (crossprod < 0) {
 	  pathOut->lineTo(pathIn->pts[j0].x - wdyNext,
 			  pathIn->pts[j0].y + wdxNext);
 	  // miter join inside limit
-	  if (state->lineJoin == splashLineJoinMiter &&
+	  if (lineJoin == splashLineJoinMiter &&
 	      splashSqrt(miter) <= state->miterLimit) {
 	    pathOut->lineTo(pathIn->pts[j0].x - wdy + wdx * m,
 			    pathIn->pts[j0].y + wdx + wdy * m);
@@ -6420,12 +6953,12 @@
 			    pathIn->pts[j0].y + wdx);
 	  }
 
-	// angle >= 180
+	// join angle >= 180
 	} else {
 	  pathOut->lineTo(pathIn->pts[j0].x + wdy,
 			  pathIn->pts[j0].y - wdx);
 	  // miter join inside limit
-	  if (state->lineJoin == splashLineJoinMiter &&
+	  if (lineJoin == splashLineJoinMiter &&
 	      splashSqrt(miter) <= state->miterLimit) {
 	    pathOut->lineTo(pathIn->pts[j0].x + wdy + wdx * m,
 			    pathIn->pts[j0].y - wdx + wdy * m);
@@ -6443,36 +6976,106 @@
     }
 
     // add stroke adjustment hints
-    if (state->strokeAdjust) {
-      if (seg == 0 && !closed) {
-	if (state->lineCap == splashLineCapButt) {
+    if (state->strokeAdjust != splashStrokeAdjustOff) {
+
+      // subpath with one segment
+      if (seg == 0 && last) {
+	switch (lineCap) {
+	case splashLineCapButt:
 	  pathOut->addStrokeAdjustHint(firstPt, left2 + 1,
-				       firstPt, firstPt + 1);
-	  if (last) {
-	    pathOut->addStrokeAdjustHint(firstPt, left2 + 1,
-					 left2 + 1, left2 + 2);
+				       firstPt, pathOut->length - 1);
+	  break;
+	case splashLineCapProjecting:
+	  pathOut->addStrokeAdjustHint(firstPt, left2 + 1,
+				       firstPt, pathOut->length - 1, gTrue);
+	  break;
+	case splashLineCapRound:
+	  break;
+	}
+	pathOut->addStrokeAdjustHint(left2, right2,
+				     firstPt, pathOut->length - 1);
+      } else {
+
+	// start of subpath
+	if (seg == 1) {
+
+	  // start cap
+	  if (!closed) {
+	    switch (lineCap) {
+	    case splashLineCapButt:
+	      pathOut->addStrokeAdjustHint(firstPt, left1 + 1,
+					   firstPt, firstPt + 1);
+	      pathOut->addStrokeAdjustHint(firstPt, left1 + 1,
+					   right1 + 1, right1 + 1);
+	      break;
+	    case splashLineCapProjecting:
+	      pathOut->addStrokeAdjustHint(firstPt, left1 + 1,
+					   firstPt, firstPt + 1, gTrue);
+	      pathOut->addStrokeAdjustHint(firstPt, left1 + 1,
+					   right1 + 1, right1 + 1, gTrue);
+	      break;
+	    case splashLineCapRound:
+	      break;
+	    }
 	  }
-	} else if (state->lineCap == splashLineCapProjecting) {
-	  if (last) {
-	    pathOut->addStrokeAdjustHint(firstPt + 1, left2 + 2,
-					 firstPt + 1, firstPt + 2);
-	    pathOut->addStrokeAdjustHint(firstPt + 1, left2 + 2,
-					 left2 + 2, left2 + 3);
-	  } else {
-	    pathOut->addStrokeAdjustHint(firstPt + 1, left2 + 1,
-					 firstPt + 1, firstPt + 2);
-	  }
+
+	  // first segment
+	  pathOut->addStrokeAdjustHint(left1, right1, firstPt, left2);
+	  pathOut->addStrokeAdjustHint(left1, right1, right2 + 1, right2 + 1);
 	}
-      }
-      if (seg >= 1) {
-	if (seg >= 2) {
+
+	// middle of subpath
+	if (seg > 1) {
 	  pathOut->addStrokeAdjustHint(left1, right1, left0 + 1, right0);
 	  pathOut->addStrokeAdjustHint(left1, right1, join0, left2);
-	} else {
-	  pathOut->addStrokeAdjustHint(left1, right1, firstPt, left2);
+	  pathOut->addStrokeAdjustHint(left1, right1, right2 + 1, right2 + 1);
 	}
-	pathOut->addStrokeAdjustHint(left1, right1, right2 + 1, right2 + 1);
+
+	// end of subpath
+	if (last) {
+
+	  if (closed) {
+	    // first segment
+	    pathOut->addStrokeAdjustHint(leftFirst, rightFirst,
+					 left2 + 1, right2);
+	    pathOut->addStrokeAdjustHint(leftFirst, rightFirst,
+					 join2, pathOut->length - 1);
+
+	    // last segment
+	    pathOut->addStrokeAdjustHint(left2, right2,
+					 left1 + 1, right1);
+	    pathOut->addStrokeAdjustHint(left2, right2,
+					 join1, pathOut->length - 1);
+	    pathOut->addStrokeAdjustHint(left2, right2,
+					 leftFirst - 1, leftFirst);
+	    pathOut->addStrokeAdjustHint(left2, right2,
+					 rightFirst + 1, rightFirst + 1);
+
+	  } else {
+
+	    // last segment
+	    pathOut->addStrokeAdjustHint(left2, right2,
+					 left1 + 1, right1);
+	    pathOut->addStrokeAdjustHint(left2, right2,
+					 join1, pathOut->length - 1);
+
+	    // end cap
+	    switch (lineCap) {
+	    case splashLineCapButt:
+	      pathOut->addStrokeAdjustHint(left2 - 1, left2 + 1,
+					   left2 + 1, left2 + 2);
+	      break;
+	    case splashLineCapProjecting:
+	      pathOut->addStrokeAdjustHint(left2 - 1, left2 + 1,
+					   left2 + 1, left2 + 2, gTrue);
+	      break;
+	    case splashLineCapRound:
+	      break;
+	    }
+	  }
+	}
       }
+
       left0 = left1;
       left1 = left2;
       right0 = right1;
@@ -6483,34 +7086,6 @@
 	leftFirst = left2;
 	rightFirst = right2;
       }
-      if (last) {
-	if (seg >= 2) {
-	  pathOut->addStrokeAdjustHint(left1, right1, left0 + 1, right0);
-	  pathOut->addStrokeAdjustHint(left1, right1,
-				       join0, pathOut->length - 1);
-	} else {
-	  pathOut->addStrokeAdjustHint(left1, right1,
-				       firstPt, pathOut->length - 1);
-	}
-	if (closed) {
-	  pathOut->addStrokeAdjustHint(left1, right1, firstPt, leftFirst);
-	  pathOut->addStrokeAdjustHint(left1, right1,
-				       rightFirst + 1, rightFirst + 1);
-	  pathOut->addStrokeAdjustHint(leftFirst, rightFirst,
-				       left1 + 1, right1);
-	  pathOut->addStrokeAdjustHint(leftFirst, rightFirst,
-				       join1, pathOut->length - 1);
-	}
-	if (!closed && seg > 0) {
-	  if (state->lineCap == splashLineCapButt) {
-	    pathOut->addStrokeAdjustHint(left1 - 1, left1 + 1,
-					 left1 + 1, left1 + 2);
-	  } else if (state->lineCap == splashLineCapProjecting) {
-	    pathOut->addStrokeAdjustHint(left1 - 1, left1 + 2,
-					 left1 + 2, left1 + 3);
-	  }
-	}
-      }
     }
 
     i0 = j0;
@@ -6525,6 +7100,29 @@
   return pathOut;
 }
 
+SplashClipResult Splash::limitRectToClipRect(int *xMin, int *yMin,
+					     int *xMax, int *yMax) {
+  int t;
+
+  if ((t = state->clip->getXMinI(state->strokeAdjust)) > *xMin) {
+    *xMin = t;
+  }
+  if ((t = state->clip->getXMaxI(state->strokeAdjust) + 1) < *xMax) {
+    *xMax = t;
+  }
+  if ((t = state->clip->getYMinI(state->strokeAdjust)) > *yMin) {
+    *yMin = t;
+  }
+  if ((t = state->clip->getYMaxI(state->strokeAdjust) + 1) < *yMax) {
+    *yMax = t;
+  }
+  if (*xMin >= *xMax || *yMin >= *yMax) {
+    return splashClipAllOutside;
+  }
+  return state->clip->testRect(*xMin, *yMin, *xMax - 1, *yMax - 1,
+			       state->strokeAdjust);
+}
+
 void Splash::dumpPath(SplashPath *path) {
   int i;
 
@@ -6536,6 +7134,15 @@
 	   (path->flags[i] & splashPathClosed) ? " closed" : "",
 	   (path->flags[i] & splashPathCurve) ? " curve" : "");
   }
+  if (path->hintsLength == 0) {
+    printf("  no hints\n");
+  } else {
+    for (i = 0; i < path->hintsLength; ++i) {
+      printf("  hint %3d: ctrl0=%d ctrl1=%d pts=%d..%d\n",
+	     i, path->hints[i].ctrl0, path->hints[i].ctrl1,
+	     path->hints[i].firstPt, path->hints[i].lastPt);
+    }
+  }
 }
 
 void Splash::dumpXPath(SplashXPath *path) {

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/splash/Splash.h
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/splash/Splash.h	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/splash/Splash.h	2017-11-01 18:15:56 UTC (rev 780)
@@ -95,7 +95,7 @@
   SplashCoord *getLineDash();
   int getLineDashLength();
   SplashCoord getLineDashPhase();
-  GBool getStrokeAdjust();
+  SplashStrokeAdjustMode getStrokeAdjust();
   SplashClip *getClip();
   SplashBitmap *getSoftMask();
   GBool getInNonIsolatedGroup();
@@ -118,7 +118,7 @@
   // the <lineDash> array will be copied
   void setLineDash(SplashCoord *lineDash, int lineDashLength,
 		   SplashCoord lineDashPhase);
-  void setStrokeAdjust(GBool strokeAdjust);
+  void setStrokeAdjust(SplashStrokeAdjustMode strokeAdjust);
   // NB: uses transformed coordinates.
   void clipResetToRect(SplashCoord x0, SplashCoord y0,
 		       SplashCoord x1, SplashCoord y1);
@@ -133,6 +133,7 @@
 			      GBool nonIsolated, GBool knockout);
   void setTransfer(Guchar *red, Guchar *green, Guchar *blue, Guchar *gray);
   void setOverprintMask(Guint overprintMask);
+  void setEnablePathSimplification(GBool en);
 
   //----- state save/restore
 
@@ -150,9 +151,6 @@
   // Fill a path using the current fill pattern.
   SplashError fill(SplashPath *path, GBool eo);
 
-  // Fill a path, XORing with the current fill pattern.
-  SplashError xorFill(SplashPath *path, GBool eo);
-
   // Draw a character, using the current fill pattern.
   SplashError fillChar(SplashCoord x, SplashCoord y, int c, SplashFont *font);
 
@@ -213,6 +211,12 @@
   SplashError blitTransparent(SplashBitmap *src, int xSrc, int ySrc,
 			      int xDest, int yDest, int w, int h);
 
+  // Copy a rectangular region from the bitmap belonging to this
+  // Splash object to <dest>.  The alpha values are corrected for a
+  // non-isolated group.
+  SplashError blitCorrectedAlpha(SplashBitmap *dest, int xSrc, int ySrc,
+				 int xDest, int yDest, int w, int h);
+
   //----- misc
 
   // Construct a path for a stroke, given the path to be stroked and
@@ -220,8 +224,15 @@
   // the current state.  If <flatten> is true, this function will
   // first flatten the path and handle the linedash.
   SplashPath *makeStrokePath(SplashPath *path, SplashCoord w,
+			     int lineCap, int lineJoin,
 			     GBool flatten = gTrue);
 
+  // Reduce the size of a rectangle as much as possible by moving any
+  // edges that are completely outside the clip region.  Returns the
+  // clipping status of the resulting rectangle.
+  SplashClipResult limitRectToClipRect(int *xMin, int *yMin,
+				       int *xMax, int *yMax);
+
   // Return the associated bitmap.
   SplashBitmap *getBitmap() { return bitmap; }
 
@@ -296,7 +307,8 @@
   void updateModY(int y);
   void strokeNarrow(SplashPath *path);
   void drawStrokeSpan(SplashPipe *pipe, int x0, int x1, int y, GBool noClip);
-  void strokeWide(SplashPath *path, SplashCoord w);
+  void strokeWide(SplashPath *path, SplashCoord w,
+		  int lineCap, int lineJoin);
   SplashPath *flattenPath(SplashPath *path, SplashCoord *matrix,
 			  SplashCoord flatness);
   void flattenCurve(SplashCoord x0, SplashCoord y0,
@@ -407,10 +419,10 @@
   int bitmapComps;
   SplashState *state;
   Guchar *scanBuf;
+  Guchar *scanBuf2;
   SplashBitmap			// for transparency groups, this is the bitmap
     *groupBackBitmap;		//   containing the alpha0/color0 values
   int groupBackX, groupBackY;	// offset within groupBackBitmap
-  Guchar aaGamma[256];
   SplashCoord minLineWidth;
   int modXMin, modYMin, modXMax, modYMax;
   SplashClipResult opClipRes;

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashBitmap.cc
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashBitmap.cc	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashBitmap.cc	2017-11-01 18:15:56 UTC (rev 780)
@@ -15,6 +15,7 @@
 #include <stdio.h>
 #include <limits.h>
 #include "gmem.h"
+#include "gmempp.h"
 #include "SplashErrorCodes.h"
 #include "SplashBitmap.h"
 
@@ -154,7 +155,18 @@
 
 #if SPLASH_CMYK
   case splashModeCMYK8:
-    // PNM doesn't support CMYK
+    fprintf(f, "P7\n");
+    fprintf(f, "WIDTH %d\n", width);
+    fprintf(f, "HEIGHT %d\n", height);
+    fprintf(f, "DEPTH 4\n");
+    fprintf(f, "MAXVAL 255\n");
+    fprintf(f, "TUPLTYPE CMYK\n");
+    fprintf(f, "ENDHDR\n");
+    row = data;
+    for (y = 0; y < height; ++y) {
+      fwrite(row, 1, 4 * width, f);
+      row += rowSize;
+    }
     break;
 #endif
 

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashClip.cc
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashClip.cc	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashClip.cc	2017-11-01 18:15:56 UTC (rev 780)
@@ -15,6 +15,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include "gmem.h"
+#include "gmempp.h"
 #include "SplashErrorCodes.h"
 #include "SplashPath.h"
 #include "SplashXPath.h"
@@ -52,6 +53,8 @@
   eo = NULL;
   scanners = NULL;
   length = size = 0;
+  isSimple = gTrue;
+  prev = NULL;
   if ((w = hardXMax + 1) <= 0) {
     w = 1;
   }
@@ -59,7 +62,7 @@
 }
 
 SplashClip::SplashClip(SplashClip *clip) {
-  int w, i;
+  int w;
 
   hardXMin = clip->hardXMin;
   hardYMin = clip->hardYMin;
@@ -75,17 +78,12 @@
   yMaxI = clip->yMaxI;
   intBoundsValid = clip->intBoundsValid;
   intBoundsStrokeAdjust = clip->intBoundsStrokeAdjust;
-  length = clip->length;
-  size = clip->size;
-  paths = (SplashXPath **)gmallocn(size, sizeof(SplashXPath *));
-  eo = (Guchar *)gmallocn(size, sizeof(Guchar));
-  scanners = (SplashXPathScanner **)
-                 gmallocn(size, sizeof(SplashXPathScanner *));
-  for (i = 0; i < length; ++i) {
-    paths[i] = clip->paths[i]->copy();
-    eo[i] = clip->eo[i];
-    scanners[i] = new SplashXPathScanner(paths[i], eo[i], yMinI, yMaxI);
-  }
+  paths = NULL;
+  eo = NULL;
+  scanners = NULL;
+  length = size = 0;
+  isSimple = clip->isSimple;
+  prev = clip;
   if ((w = splashCeil(xMax)) <= 0) {
     w = 1;
   }
@@ -96,8 +94,8 @@
   int i;
 
   for (i = 0; i < length; ++i) {
+    delete scanners[i];
     delete paths[i];
-    delete scanners[i];
   }
   gfree(paths);
   gfree(eo);
@@ -136,6 +134,8 @@
   eo = NULL;
   scanners = NULL;
   length = size = 0;
+  isSimple = gTrue;
+  prev = NULL;
 
   if (x0 < x1) {
     xMin = x0;
@@ -202,11 +202,15 @@
 }
 
 SplashError SplashClip::clipToPath(SplashPath *path, SplashCoord *matrix,
-				   SplashCoord flatness, GBool eoA) {
+				   SplashCoord flatness, GBool eoA,
+				   GBool enablePathSimplification,
+				   SplashStrokeAdjustMode strokeAdjust) {
   SplashXPath *xPath;
   SplashCoord t;
 
-  xPath = new SplashXPath(path, matrix, flatness, gTrue);
+  xPath = new SplashXPath(path, matrix, flatness, gTrue,
+			  enablePathSimplification,
+			  strokeAdjust);
 
   // check for an empty path
   if (xPath->length == 0) {
@@ -218,36 +222,11 @@
   }
 
   // check for a rectangle
-  if (xPath->length == 4 &&
-      xPath->segs[0].y0 == xPath->segs[0].y1 &&
-      xPath->segs[1].x0 == xPath->segs[1].x1 &&
-      xPath->segs[2].x0 == xPath->segs[2].x1 &&
-      xPath->segs[3].y0 == xPath->segs[3].y1) {
-    clipToRect(xPath->segs[1].x0, xPath->segs[0].y0,
-               xPath->segs[2].x0, xPath->segs[3].y0);
+  if (xPath->isRect) {
+    clipToRect(xPath->rectX0, xPath->rectY0, xPath->rectX1, xPath->rectY1);
     delete xPath;
     return splashOk;
   }
-  if (xPath->length == 4 &&
-      xPath->segs[0].x0 == xPath->segs[0].x1 &&
-      xPath->segs[1].y0 == xPath->segs[1].y1 &&
-      xPath->segs[2].x0 == xPath->segs[2].x1 &&
-      xPath->segs[3].y0 == xPath->segs[3].y1) {
-    clipToRect(xPath->segs[0].x0, xPath->segs[1].y0,
-               xPath->segs[2].x0, xPath->segs[3].y0);
-    delete xPath;
-    return splashOk;
-  }
-  if (xPath->length == 4 &&
-      xPath->segs[0].x0 == xPath->segs[0].x1 &&
-      xPath->segs[1].x0 == xPath->segs[1].x1 &&
-      xPath->segs[2].y0 == xPath->segs[2].y1 &&
-      xPath->segs[3].y0 == xPath->segs[3].y1) {
-    clipToRect(xPath->segs[0].x0, xPath->segs[2].y0,
-               xPath->segs[1].x0, xPath->segs[3].y0);
-    delete xPath;
-    return splashOk;
-  }
 
   grow(1);
   paths[length] = xPath;
@@ -268,6 +247,7 @@
   scanners[length] = new SplashXPathScanner(xPath, eoA, splashFloor(yMin),
 					    splashCeil(yMax) - 1);
   ++length;
+  isSimple = gFalse;
 
   return splashOk;
 }
@@ -274,7 +254,7 @@
 
 SplashClipResult SplashClip::testRect(int rectXMin, int rectYMin,
 				      int rectXMax, int rectYMax,
-				      GBool strokeAdjust) {
+				      SplashStrokeAdjustMode strokeAdjust) {
   // In general, this function tests the rectangle:
   //     x = [rectXMin, rectXMax + 1)    (note: coords are ints)
   //     y = [rectYMin, rectYMax + 1)
@@ -282,7 +262,7 @@
   //     x = [xMin, xMax)                (note: coords are fp)
   //     y = [yMin, yMax)
 
-  if (strokeAdjust && length == 0) {
+  if (strokeAdjust != splashStrokeAdjustOff && isSimple) {
     // special case for stroke adjustment with a simple clipping
     // rectangle -- the clipping region is:
     //     x = [xMinI, xMaxI + 1)
@@ -313,7 +293,7 @@
 	(SplashCoord)rectYMin >= yMax) {
       return splashClipAllOutside;
     }
-    if (length == 0 &&
+    if (isSimple &&
 	(SplashCoord)rectXMin >= xMin &&
 	(SplashCoord)(rectXMax + 1) <= xMax &&
 	(SplashCoord)rectYMin >= yMin &&
@@ -325,9 +305,10 @@
 }
 
 void SplashClip::clipSpan(Guchar *line, int y, int x0, int x1,
-			  GBool strokeAdjust) {
+			  SplashStrokeAdjustMode strokeAdjust) {
+  SplashClip *clip;
   SplashCoord d;
-  int x0a, x1a, x, i;
+  int x0a, x1a, x0b, x1b, x, i;
 
   updateIntBounds(strokeAdjust);
 
@@ -360,7 +341,7 @@
   //--- clip to the floating point rectangle
   //    (if stroke adjustment is disabled)
 
-  if (!strokeAdjust) {
+  if (strokeAdjust == splashStrokeAdjustOff) {
 
     // clip left edge (xMin)
     if (x0a == xMinI) {
@@ -391,22 +372,31 @@
     }
   }
 
-  if (length == 0) {
+  if (isSimple) {
     return;
   }
 
   //--- clip to the paths
 
-  for (i = 0; i < length; ++i) {
-    scanners[i]->getSpan(buf, y, x0a, x1a);
-    for (x = x0a; x <= x1a; ++x) {
-      line[x] = mul255(line[x], buf[x]);
+  for (clip = this; clip; clip = clip->prev) {
+    for (i = 0; i < clip->length; ++i) {
+      clip->scanners[i]->getSpan(buf, y, x0a, x1a, &x0b, &x1b);
+      if (x0a < x0b) {
+	memset(line + x0a, 0, x0b - x0a);
+      }
+      for (x = x0b; x <= x1b; ++x) {
+	line[x] = mul255(line[x], buf[x]);
+      }
+      if (x1b < x1a) {
+	memset(line + x1b + 1, 0, x1a - x1b);
+      }
     }
   }
 }
 
 GBool SplashClip::clipSpanBinary(Guchar *line, int y, int x0, int x1,
-				 GBool strokeAdjust) {
+				 SplashStrokeAdjustMode strokeAdjust) {
+  SplashClip *clip;
   int x0a, x1a, x0b, x1b, x, i;
   Guchar any;
 
@@ -438,7 +428,7 @@
     return gFalse;
   }
 
-  if (length == 0) {
+  if (isSimple) {
     for (x = x0a; x <= x1a; ++x) {
       if (line[x]) {
 	return gTrue;
@@ -448,52 +438,63 @@
   }
 
   any = 0;
-  for (i = 0; i < length; ++i) {
-    scanners[i]->getSpanBinary(buf, y, x0a, x1a);
-    for (x0b = x0a; x0b <= x1a && !buf[x0b]; ++x0b) ;
-    if (x0a < x0b) {
-      memset(line + x0a, 0, x0b - x0a);
+  for (clip = this; clip; clip = clip->prev) {
+    for (i = 0; i < clip->length; ++i) {
+      clip->scanners[i]->getSpanBinary(buf, y, x0a, x1a, &x0b, &x1b);
+      if (x0a < x0b) {
+	memset(line + x0a, 0, x0b - x0a);
+      }
+      for (x = x0b; x <= x1b; ++x) {
+	line[x] &= buf[x];
+	any |= line[x];
+      }
+      if (x1b < x1a) {
+	memset(line + x1b + 1, 0, x1a - x1b);
+      }
     }
-    for (x1b = x1a; x1b >= x0b && !buf[x1b]; --x1b) ;
-    if (x1b < x1a) {
-      memset(line + x1b + 1, 0, x1a - x1b);
-    }
-    for (x = x0b; x <= x1b; ++x) {
-      line[x] &= buf[x];
-      any |= line[x];
-    }
   }
 
   return any != 0;
 }
 
-int SplashClip::getXMinI(GBool strokeAdjust) {
+int SplashClip::getXMinI(SplashStrokeAdjustMode strokeAdjust) {
   updateIntBounds(strokeAdjust);
   return xMinI;
 }
 
-int SplashClip::getXMaxI(GBool strokeAdjust) {
+int SplashClip::getXMaxI(SplashStrokeAdjustMode strokeAdjust) {
   updateIntBounds(strokeAdjust);
   return xMaxI;
 }
 
-int SplashClip::getYMinI(GBool strokeAdjust) {
+int SplashClip::getYMinI(SplashStrokeAdjustMode strokeAdjust) {
   updateIntBounds(strokeAdjust);
   return yMinI;
 }
 
-int SplashClip::getYMaxI(GBool strokeAdjust) {
+int SplashClip::getYMaxI(SplashStrokeAdjustMode strokeAdjust) {
   updateIntBounds(strokeAdjust);
   return yMaxI;
 }
 
-void SplashClip::updateIntBounds(GBool strokeAdjust) {
+int SplashClip::getNumPaths() {
+  SplashClip *clip;
+  int n;
+
+  n = 0;
+  for (clip = this; clip; clip = clip->prev) {
+    n += clip->length;
+  }
+  return n;
+}
+
+void SplashClip::updateIntBounds(SplashStrokeAdjustMode strokeAdjust) {
   if (intBoundsValid && strokeAdjust == intBoundsStrokeAdjust) {
     return;
   }
-  if (strokeAdjust && length == 0) {
-    splashStrokeAdjust(xMin, xMax, &xMinI, &xMaxI);
-    splashStrokeAdjust(yMin, yMax, &yMinI, &yMaxI);
+  if (strokeAdjust != splashStrokeAdjustOff && isSimple) {
+    splashStrokeAdjust(xMin, xMax, &xMinI, &xMaxI, strokeAdjust);
+    splashStrokeAdjust(yMin, yMax, &yMinI, &yMaxI, strokeAdjust);
   } else {
     xMinI = splashFloor(xMin);
     yMinI = splashFloor(yMin);

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashClip.h
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashClip.h	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashClip.h	2017-11-01 18:15:56 UTC (rev 780)
@@ -57,7 +57,9 @@
 
   // Interesect the clip with <path>.
   SplashError clipToPath(SplashPath *path, SplashCoord *matrix,
-			 SplashCoord flatness, GBool eoA);
+			 SplashCoord flatness, GBool eoA,
+			 GBool enablePathSimplification,
+			 SplashStrokeAdjustMode strokeAdjust);
 
   // Tests a rectangle against the clipping region.  Returns one of:
   //   - splashClipAllInside if the entire rectangle is inside the
@@ -70,18 +72,18 @@
   //     outside the clipping region
   SplashClipResult testRect(int rectXMin, int rectYMin,
 			    int rectXMax, int rectYMax,
-			    GBool strokeAdjust);
+			    SplashStrokeAdjustMode strokeAdjust);
 
   // Clip a scan line.  Modifies line[] by multiplying with clipping
   // shape values for one scan line: ([x0, x1], y).
   void clipSpan(Guchar *line, int y, int x0, int x1,
-		GBool strokeAdjust);
+		SplashStrokeAdjustMode strokeAdjust);
 
   // Like clipSpan(), but uses the values 0 and 255 only.
   // Returns true if there are any non-zero values in the result
   // (i.e., returns false if the entire line is clipped out).
   GBool clipSpanBinary(Guchar *line, int y, int x0, int x1,
-		       GBool strokeAdjust);
+		       SplashStrokeAdjustMode strokeAdjust);
 
   // Get the rectangle part of the clip region.
   SplashCoord getXMin() { return xMin; }
@@ -90,19 +92,19 @@
   SplashCoord getYMax() { return yMax; }
 
   // Get the rectangle part of the clip region, in integer coordinates.
-  int getXMinI(GBool strokeAdjust);
-  int getXMaxI(GBool strokeAdjust);
-  int getYMinI(GBool strokeAdjust);
-  int getYMaxI(GBool strokeAdjust);
+  int getXMinI(SplashStrokeAdjustMode strokeAdjust);
+  int getXMaxI(SplashStrokeAdjustMode strokeAdjust);
+  int getYMinI(SplashStrokeAdjustMode strokeAdjust);
+  int getYMaxI(SplashStrokeAdjustMode strokeAdjust);
 
   // Get the number of arbitrary paths used by the clip region.
-  int getNumPaths() { return length; }
+  int getNumPaths();
 
 private:
 
   SplashClip(SplashClip *clip);
   void grow(int nPaths);
-  void updateIntBounds(GBool strokeAdjust);
+  void updateIntBounds(SplashStrokeAdjustMode strokeAdjust);
 
   int hardXMin, hardYMin,	// coordinates cannot fall outside of
       hardXMax, hardYMax;	//   [hardXMin, hardXMax), [hardYMin, hardYMax)
@@ -120,6 +122,8 @@
   Guchar *eo;
   SplashXPathScanner **scanners;
   int length, size;
+  GBool isSimple;
+  SplashClip *prev;
   Guchar *buf;
 };
 

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashFTFont.cc
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashFTFont.cc	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashFTFont.cc	2017-11-01 18:15:56 UTC (rev 780)
@@ -8,7 +8,7 @@
 
 #include <aconf.h>
 
-#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H
+#if HAVE_FREETYPE_H
 
 #ifdef USE_GCC_PRAGMAS
 #pragma implementation
@@ -19,6 +19,7 @@
 #include FT_SIZES_H
 #include FT_GLYPH_H
 #include "gmem.h"
+#include "gmempp.h"
 #include "SplashMath.h"
 #include "SplashGlyphBitmap.h"
 #include "SplashPath.h"
@@ -66,6 +67,10 @@
   // if the textMat values are too small, FreeType's fixed point
   // arithmetic doesn't work so well
   textScale = splashDist(0, 0, textMat[2], textMat[3]) / size;
+  // avoid problems with singular (or close-to-singular) matrices
+  if (textScale < 0.00001) {
+    textScale = 0.00001;
+  }
 
   div = face->bbox.xMax > 20000 ? 65536 : 1;
 
@@ -220,7 +225,7 @@
   SplashFTFontFile *ff;
   FT_Vector offset;
   FT_GlyphSlot slot;
-  FT_UInt gid;
+  int gid;
   FT_Int32 flags;
   int rowSize;
   Guchar *p, *q;
@@ -235,11 +240,11 @@
   slot = ff->face->glyph;
 
   if (ff->codeToGID && c < ff->codeToGIDLen) {
-    gid = (FT_UInt)ff->codeToGID[c];
+    gid = ff->codeToGID[c];
   } else {
-    gid = (FT_UInt)c;
+    gid = c;
   }
-  if (ff->trueType && gid < 0) {
+  if (ff->fontType == splashFontTrueType && gid < 0) {
     // skip the TrueType notdef glyph
     return gFalse;
   }
@@ -258,13 +263,19 @@
   flags = FT_LOAD_NO_BITMAP;
   if (ff->engine->flags & splashFTNoHinting) {
     flags |= FT_LOAD_NO_HINTING;
-  } else if (ff->useLightHinting) {
+  } else if (ff->fontType == splashFontType1) {
     flags |= FT_LOAD_TARGET_LIGHT;
   } else {
     flags |= FT_LOAD_NO_AUTOHINT;
   }
-  if (FT_Load_Glyph(ff->face, gid, flags)) {
-    return gFalse;
+  if (FT_Load_Glyph(ff->face, (FT_UInt)gid, flags)) {
+    // fonts with broken hinting instructions can cause errors here;
+    // try again with no hinting (this is probably only relevant for
+    // TrueType fonts)
+    flags = FT_LOAD_NO_BITMAP | FT_LOAD_NO_HINTING;
+    if (FT_Load_Glyph(ff->face, (FT_UInt)gid, flags)) {
+      return gFalse;
+    }
   }
   if (FT_Render_Glyph(slot, aa ? FT_RENDER_MODE_NORMAL
 		               : FT_RENDER_MODE_MONO)) {
@@ -321,7 +332,7 @@
   SplashFTFontFile *ff;
   SplashFTFontPath path;
   FT_GlyphSlot slot;
-  FT_UInt gid;
+  int gid;
   FT_Glyph glyph;
 
   ff = (SplashFTFontFile *)fontFile;
@@ -331,14 +342,20 @@
   if (ff->codeToGID && c < ff->codeToGIDLen) {
     gid = ff->codeToGID[c];
   } else {
-    gid = (FT_UInt)c;
+    gid = c;
   }
-  if (ff->trueType && gid < 0) {
+  if (ff->fontType == splashFontTrueType && gid < 0) {
     // skip the TrueType notdef glyph
     return NULL;
   }
-  if (FT_Load_Glyph(ff->face, gid, FT_LOAD_NO_BITMAP)) {
-    return NULL;
+  if (FT_Load_Glyph(ff->face, (FT_UInt)gid, FT_LOAD_NO_BITMAP)) {
+    // fonts with broken hinting instructions can cause errors here;
+    // try again with no hinting (this is probably only relevant for
+    // TrueType fonts)
+    if (FT_Load_Glyph(ff->face, (FT_UInt)gid,
+		      FT_LOAD_NO_BITMAP | FT_LOAD_NO_HINTING)) {
+      return NULL;
+    }
   }
   if (FT_Get_Glyph(slot, &glyph)) {
     return NULL;
@@ -429,4 +446,4 @@
   return 0;
 }
 
-#endif // HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H
+#endif // HAVE_FREETYPE_H

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashFTFont.h
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashFTFont.h	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashFTFont.h	2017-11-01 18:15:56 UTC (rev 780)
@@ -11,7 +11,7 @@
 
 #include <aconf.h>
 
-#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H
+#if HAVE_FREETYPE_H
 
 #ifdef USE_GCC_PRAGMAS
 #pragma interface
@@ -55,6 +55,6 @@
   SplashCoord textScale;
 };
 
-#endif // HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H
+#endif // HAVE_FREETYPE_H
 
 #endif

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashFTFontEngine.cc
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashFTFontEngine.cc	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashFTFontEngine.cc	2017-11-01 18:15:56 UTC (rev 780)
@@ -8,7 +8,7 @@
 
 #include <aconf.h>
 
-#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H
+#if HAVE_FREETYPE_H
 
 #ifdef USE_GCC_PRAGMAS
 #pragma implementation
@@ -19,6 +19,7 @@
 #  include <unistd.h>
 #endif
 #include "gmem.h"
+#include "gmempp.h"
 #include "GString.h"
 #include "gfile.h"
 #include "FoFiTrueType.h"
@@ -87,13 +88,13 @@
 						  GBool deleteFile,
 #endif
 						  const char **enc) {
-  return SplashFTFontFile::loadType1Font(this, idA,
+  return SplashFTFontFile::loadType1Font(this, idA, splashFontType1,
 #if LOAD_FONTS_FROM_MEM
 					 fontBuf,
 #else
 					 fileName, deleteFile,
 #endif
-					 enc, gTrue);
+					 enc);
 }
 
 SplashFontFile *SplashFTFontEngine::loadType1CFont(SplashFontFileID *idA,
@@ -104,13 +105,13 @@
 						   GBool deleteFile,
 #endif
 						   const char **enc) {
-  return SplashFTFontFile::loadType1Font(this, idA,
+  return SplashFTFontFile::loadType1Font(this, idA, splashFontType1C,
 #if LOAD_FONTS_FROM_MEM
 					 fontBuf,
 #else
 					 fileName, deleteFile,
 #endif
-					 enc, gFalse);
+					 enc);
 }
 
 SplashFontFile *SplashFTFontEngine::loadOpenTypeT1CFont(SplashFontFileID *idA,
@@ -143,8 +144,8 @@
     fontBuf2 = new GString();
     ff->convertToType1(NULL, enc, gFalse, &gstringWrite, fontBuf2);
     delete ff;
-    ret = SplashFTFontFile::loadType1Font(this, idA, fontBuf2, enc,
-					  gFalse);
+    ret = SplashFTFontFile::loadType1Font(this, idA, splashFontType1,
+					  fontBuf2, enc);
     if (ret) {
       delete fontBuf;
     } else {
@@ -159,8 +160,9 @@
     ff->convertToType1(NULL, enc, gFalse, &fileWrite, tmpFile);
     delete ff;
     fclose(tmpFile);
-    ret = SplashFTFontFile::loadType1Font(this, idA, tmpFileName->getCString(),
-					  gTrue, enc, gFalse);
+    ret = SplashFTFontFile::loadType1Font(this, idA, splashFontType1,
+					  tmpFileName->getCString(),
+					  gTrue, enc);
     if (ret) {
       if (deleteFile) {
 	unlink(fileName);
@@ -172,13 +174,13 @@
 #endif
   } else {
     delete ff;
-    ret = SplashFTFontFile::loadType1Font(this, idA,
+    ret = SplashFTFontFile::loadType1Font(this, idA, splashFontOpenTypeT1C,
 #if LOAD_FONTS_FROM_MEM
 					  fontBuf,
 #else
 					  fileName, deleteFile,
 #endif
-					  enc, gFalse);
+					  enc);
   }
   return ret;
 }
@@ -185,12 +187,13 @@
 
 SplashFontFile *SplashFTFontEngine::loadCIDFont(SplashFontFileID *idA,
 #if LOAD_FONTS_FROM_MEM
-						GString *fontBuf
+						GString *fontBuf,
 #else
 						char *fileName,
-						GBool deleteFile
+						GBool deleteFile,
 #endif
-						) {
+						int *codeToGID,
+						int codeToGIDLen) {
   FoFiType1C *ff;
   int *cidToGIDMap;
   int nCIDs;
@@ -197,9 +200,12 @@
   SplashFontFile *ret;
 
   // check for a CFF font
-  if (useCIDs) {
+  if (codeToGID) {
     cidToGIDMap = NULL;
     nCIDs = 0;
+  } else if (useCIDs) {
+    cidToGIDMap = NULL;
+    nCIDs = 0;
 #if LOAD_FONTS_FROM_MEM
   } else if ((ff = FoFiType1C::make(fontBuf->getCString(),
 				    fontBuf->getLength()))) {
@@ -212,13 +218,14 @@
     cidToGIDMap = NULL;
     nCIDs = 0;
   }
-  ret = SplashFTFontFile::loadCIDFont(this, idA,
+  ret = SplashFTFontFile::loadCIDFont(this, idA, splashFontCID,
 #if LOAD_FONTS_FROM_MEM
 				      fontBuf,
 #else
 				      fileName, deleteFile,
 #endif
-				      cidToGIDMap, nCIDs);
+				      codeToGID ? codeToGID : cidToGIDMap,
+				      codeToGID ? codeToGIDLen : nCIDs);
   if (!ret) {
     gfree(cidToGIDMap);
   }
@@ -266,8 +273,8 @@
     if (!useCIDs) {
       cidToGIDMap = ff->getCIDToGIDMap(&nCIDs);
     }
-    ret = SplashFTFontFile::loadCIDFont(this, idA, fontBuf2,
-					cidToGIDMap, nCIDs);
+    ret = SplashFTFontFile::loadCIDFont(this, idA, splashFontOpenTypeCFF,
+					fontBuf2, cidToGIDMap, nCIDs);
     if (ret) {
       delete fontBuf;
     } else {
@@ -284,7 +291,7 @@
     if (!useCIDs) {
       cidToGIDMap = ff->getCIDToGIDMap(&nCIDs);
     }
-    ret = SplashFTFontFile::loadCIDFont(this, idA,
+    ret = SplashFTFontFile::loadCIDFont(this, idA, splashFontOpenTypeCFF,
 					tmpFileName->getCString(), gTrue,
 					cidToGIDMap, nCIDs);
     if (ret) {
@@ -300,7 +307,7 @@
     if (!codeToGID && !useCIDs && ff->isOpenTypeCFF()) {
       cidToGIDMap = ff->getCIDToGIDMap(&nCIDs);
     }
-    ret = SplashFTFontFile::loadCIDFont(this, idA,
+    ret = SplashFTFontFile::loadCIDFont(this, idA, splashFontOpenTypeCFF,
 #if LOAD_FONTS_FROM_MEM
 					fontBuf,
 #else
@@ -356,7 +363,7 @@
   fclose(tmpFile);
 #endif
   delete ff;
-  ret = SplashFTFontFile::loadTrueTypeFont(this, idA,
+  ret = SplashFTFontFile::loadTrueTypeFont(this, idA, splashFontTrueType,
 #if LOAD_FONTS_FROM_MEM
 					   fontBuf2,
 #else
@@ -382,4 +389,4 @@
   return ret;
 }
 
-#endif // HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H
+#endif // HAVE_FREETYPE_H

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashFTFontEngine.h
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashFTFontEngine.h	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashFTFontEngine.h	2017-11-01 18:15:56 UTC (rev 780)
@@ -11,7 +11,7 @@
 
 #include <aconf.h>
 
-#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H
+#if HAVE_FREETYPE_H
 
 #ifdef USE_GCC_PRAGMAS
 #pragma interface
@@ -60,11 +60,11 @@
 				      const char **enc);
   SplashFontFile *loadCIDFont(SplashFontFileID *idA,
 #if LOAD_FONTS_FROM_MEM
-			      GString *fontBuf
+			      GString *fontBuf,
 #else
-			      char *fileName, GBool deleteFile
+			      char *fileName, GBool deleteFile,
 #endif
-			      );
+			      int *codeToGID, int codeToGIDLen);
   SplashFontFile *loadOpenTypeCFFFont(SplashFontFileID *idA,
 #if LOAD_FONTS_FROM_MEM
 				      GString *fontBuf,
@@ -94,6 +94,6 @@
   friend class SplashFTFont;
 };
 
-#endif // HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H
+#endif // HAVE_FREETYPE_H
 
 #endif

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashFTFontFile.cc
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashFTFontFile.cc	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashFTFontFile.cc	2017-11-01 18:15:56 UTC (rev 780)
@@ -8,7 +8,7 @@
 
 #include <aconf.h>
 
-#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H
+#if HAVE_FREETYPE_H
 
 #ifdef USE_GCC_PRAGMAS
 #pragma implementation
@@ -15,6 +15,7 @@
 #endif
 
 #include "gmem.h"
+#include "gmempp.h"
 #include "GString.h"
 #include "SplashFTFontEngine.h"
 #include "SplashFTFont.h"
@@ -26,6 +27,7 @@
 
 SplashFontFile *SplashFTFontFile::loadType1Font(SplashFTFontEngine *engineA,
 						SplashFontFileID *idA,
+						SplashFontType fontTypeA,
 #if LOAD_FONTS_FROM_MEM
 						GString *fontBufA,
 #else
@@ -32,8 +34,7 @@
 						char *fileNameA,
 						GBool deleteFileA,
 #endif
-						const char **encA,
-						GBool useLightHintingA) {
+						const char **encA) {
   FT_Face faceA;
   int *codeToGIDA;
   const char *name;
@@ -55,18 +56,18 @@
     }
   }
 
-  return new SplashFTFontFile(engineA, idA,
+  return new SplashFTFontFile(engineA, idA, fontTypeA,
 #if LOAD_FONTS_FROM_MEM
 			      fontBufA,
 #else
 			      fileNameA, deleteFileA,
 #endif
-			      faceA, codeToGIDA, 256,
-			      gFalse, useLightHintingA);
+			      faceA, codeToGIDA, 256);
 }
 
 SplashFontFile *SplashFTFontFile::loadCIDFont(SplashFTFontEngine *engineA,
 					      SplashFontFileID *idA,
+					      SplashFontType fontTypeA,
 #if LOAD_FONTS_FROM_MEM
 					      GString *fontBufA,
 #else
@@ -86,18 +87,18 @@
     return NULL;
   }
 
-  return new SplashFTFontFile(engineA, idA,
+  return new SplashFTFontFile(engineA, idA, fontTypeA,
 #if LOAD_FONTS_FROM_MEM
 			      fontBufA,
 #else
 			      fileNameA, deleteFileA,
 #endif
-			      faceA, codeToGIDA, codeToGIDLenA,
-			      gFalse, gFalse);
+			      faceA, codeToGIDA, codeToGIDLenA);
 }
 
 SplashFontFile *SplashFTFontFile::loadTrueTypeFont(SplashFTFontEngine *engineA,
 						   SplashFontFileID *idA,
+						   SplashFontType fontTypeA,
 #if LOAD_FONTS_FROM_MEM
 						   GString *fontBufA,
 #else
@@ -118,18 +119,18 @@
     return NULL;
   }
 
-  return new SplashFTFontFile(engineA, idA,
+  return new SplashFTFontFile(engineA, idA, fontTypeA,
 #if LOAD_FONTS_FROM_MEM
 			      fontBufA,
 #else
 			      fileNameA, deleteFileA,
 #endif
-			      faceA, codeToGIDA, codeToGIDLenA,
-			      gTrue, gFalse);
+			      faceA, codeToGIDA, codeToGIDLenA);
 }
 
 SplashFTFontFile::SplashFTFontFile(SplashFTFontEngine *engineA,
 				   SplashFontFileID *idA,
+				   SplashFontType fontTypeA,
 #if LOAD_FONTS_FROM_MEM
 				   GString *fontBufA,
 #else
@@ -136,12 +137,11 @@
 				   char *fileNameA, GBool deleteFileA,
 #endif
 				   FT_Face faceA,
-				   int *codeToGIDA, int codeToGIDLenA,
-				   GBool trueTypeA, GBool useLightHintingA):
+				   int *codeToGIDA, int codeToGIDLenA):
 #if LOAD_FONTS_FROM_MEM
-  SplashFontFile(idA, fontBufA)
+  SplashFontFile(idA, fontTypeA, fontBufA)
 #else
-  SplashFontFile(idA, fileNameA, deleteFileA)
+  SplashFontFile(idA, fontTypeA, fileNameA, deleteFileA)
 #endif
 {
   engine = engineA;
@@ -148,8 +148,6 @@
   face = faceA;
   codeToGID = codeToGIDA;
   codeToGIDLen = codeToGIDLenA;
-  trueType = trueTypeA;
-  useLightHinting = useLightHintingA;
 }
 
 SplashFTFontFile::~SplashFTFontFile() {
@@ -170,4 +168,4 @@
   return font;
 }
 
-#endif // HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H
+#endif // HAVE_FREETYPE_H

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashFTFontFile.h
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashFTFontFile.h	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashFTFontFile.h	2017-11-01 18:15:56 UTC (rev 780)
@@ -11,7 +11,7 @@
 
 #include <aconf.h>
 
-#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H
+#if HAVE_FREETYPE_H
 
 #ifdef USE_GCC_PRAGMAS
 #pragma interface
@@ -33,15 +33,16 @@
 
   static SplashFontFile *loadType1Font(SplashFTFontEngine *engineA,
 				       SplashFontFileID *idA,
+				       SplashFontType fontTypeA,
 #if LOAD_FONTS_FROM_MEM
 				       GString *fontBufA,
 #else
 				       char *fileNameA, GBool deleteFileA,
 #endif
-				       const char **encA,
-				       GBool useLightHintingA);
+				       const char **encA);
   static SplashFontFile *loadCIDFont(SplashFTFontEngine *engineA,
 				     SplashFontFileID *idA,
+				     SplashFontType fontTypeA,
 #if LOAD_FONTS_FROM_MEM
 				     GString *fontBufA,
 #else
@@ -50,6 +51,7 @@
 				     int *codeToGIDA, int codeToGIDLenA);
   static SplashFontFile *loadTrueTypeFont(SplashFTFontEngine *engineA,
 					  SplashFontFileID *idA,
+					  SplashFontType fontTypeA,
 #if LOAD_FONTS_FROM_MEM
 					  GString *fontBufA,
 #else
@@ -71,6 +73,7 @@
 
   SplashFTFontFile(SplashFTFontEngine *engineA,
 		   SplashFontFileID *idA,
+		   SplashFontType fontTypeA,
 #if LOAD_FONTS_FROM_MEM
 		   GString *fontBufA,
 #else
@@ -77,19 +80,16 @@
 		   char *fileNameA, GBool deleteFileA,
 #endif
 		   FT_Face faceA,
-		   int *codeToGIDA, int codeToGIDLenA,
-		   GBool trueTypeA, GBool useLightHintingA);
+		   int *codeToGIDA, int codeToGIDLenA);
 
   SplashFTFontEngine *engine;
   FT_Face face;
   int *codeToGID;
   int codeToGIDLen;
-  GBool trueType;
-  GBool useLightHinting;
 
   friend class SplashFTFont;
 };
 
-#endif // HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H
+#endif // HAVE_FREETYPE_H
 
 #endif

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashFont.cc
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashFont.cc	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashFont.cc	2017-11-01 18:15:56 UTC (rev 780)
@@ -14,6 +14,7 @@
 
 #include <string.h>
 #include "gmem.h"
+#include "gmempp.h"
 #include "SplashMath.h"
 #include "SplashGlyphBitmap.h"
 #include "SplashFontFile.h"
@@ -66,6 +67,12 @@
   // deal with rounding errors
   glyphW = xMax - xMin + 3;
   glyphH = yMax - yMin + 3;
+  if (glyphW > 1000 || glyphH > 1000) {
+    // if the glyphs are too large, don't cache them -- setting the
+    // cache bitmap size to something tiny will cause getGlyph() to
+    // fall back to the uncached case
+    glyphW = glyphH = 1;
+  }
   if (aa) {
     glyphSize = glyphW * glyphH;
   } else {
@@ -76,7 +83,7 @@
   cacheAssoc = splashFontCacheAssoc;
   for (cacheSets = splashFontCacheMaxSets;
        cacheSets > 1 &&
-	 cacheSets * cacheAssoc * glyphSize > splashFontCacheSize;
+	 glyphSize > splashFontCacheSize / (cacheSets * cacheAssoc);
        cacheSets >>= 1) ;
   cache = (Guchar *)gmallocn(cacheSets * cacheAssoc, glyphSize);
   cacheTags = (SplashFontCacheTag *)gmallocn(cacheSets * cacheAssoc,

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashFont.h
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashFont.h	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashFont.h	2017-11-01 18:15:56 UTC (rev 780)
@@ -17,6 +17,7 @@
 
 #include "gtypes.h"
 #include "SplashTypes.h"
+#include "SplashMath.h"
 
 struct SplashGlyphBitmap;
 struct SplashFontCacheTag;
@@ -54,10 +55,14 @@
   GBool matches(SplashFontFile *fontFileA, SplashCoord *matA,
 		SplashCoord *textMatA) {
     return fontFileA == fontFile &&
-           matA[0] == mat[0] && matA[1] == mat[1] &&
-           matA[2] == mat[2] && matA[3] == mat[3] &&
-           textMatA[0] == textMat[0] && textMatA[1] == textMat[1] &&
-           textMatA[2] == textMat[2] && textMatA[3] == textMat[3];
+           splashAbs(matA[0] - mat[0]) < 0.0001 &&
+	   splashAbs(matA[1] - mat[1]) < 0.0001 &&
+           splashAbs(matA[2] - mat[2]) < 0.0001 &&
+           splashAbs(matA[3] - mat[3]) < 0.0001 &&
+           splashAbs(textMatA[0] - textMat[0]) < 0.0001 &&
+           splashAbs(textMatA[1] - textMat[1]) < 0.0001 &&
+           splashAbs(textMatA[2] - textMat[2]) < 0.0001 &&
+	   splashAbs(textMatA[3] - textMat[3]) < 0.0001;
   }
 
   // Get a glyph - this does a cache lookup first, and if not found,

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashFontEngine.cc
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashFontEngine.cc	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashFontEngine.cc	2017-11-01 18:15:56 UTC (rev 780)
@@ -18,6 +18,7 @@
 #  include <unistd.h>
 #endif
 #include "gmem.h"
+#include "gmempp.h"
 #include "GString.h"
 #include "SplashMath.h"
 #include "SplashFTFontEngine.h"
@@ -37,7 +38,7 @@
 //------------------------------------------------------------------------
 
 SplashFontEngine::SplashFontEngine(
-#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H
+#if HAVE_FREETYPE_H
 				   GBool enableFreeType,
 				   Guint freeTypeFlags,
 #endif
@@ -48,7 +49,7 @@
     fontCache[i] = NULL;
   }
 
-#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H
+#if HAVE_FREETYPE_H
   if (enableFreeType) {
     ftEngine = SplashFTFontEngine::init(aa, freeTypeFlags);
   } else {
@@ -66,7 +67,7 @@
     }
   }
 
-#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H
+#if HAVE_FREETYPE_H
   if (ftEngine) {
     delete ftEngine;
   }
@@ -99,7 +100,7 @@
   SplashFontFile *fontFile;
 
   fontFile = NULL;
-#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H
+#if HAVE_FREETYPE_H
   if (!fontFile && ftEngine) {
     fontFile = ftEngine->loadType1Font(idA,
 #if LOAD_FONTS_FROM_MEM
@@ -135,7 +136,7 @@
   SplashFontFile *fontFile;
 
   fontFile = NULL;
-#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H
+#if HAVE_FREETYPE_H
   if (!fontFile && ftEngine) {
     fontFile = ftEngine->loadType1CFont(idA,
 #if LOAD_FONTS_FROM_MEM
@@ -171,7 +172,7 @@
   SplashFontFile *fontFile;
 
   fontFile = NULL;
-#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H
+#if HAVE_FREETYPE_H
   if (!fontFile && ftEngine) {
     fontFile = ftEngine->loadOpenTypeT1CFont(idA,
 #if LOAD_FONTS_FROM_MEM
@@ -198,24 +199,25 @@
 
 SplashFontFile *SplashFontEngine::loadCIDFont(SplashFontFileID *idA,
 #if LOAD_FONTS_FROM_MEM
-					      GString *fontBuf
+					      GString *fontBuf,
 #else
 					      char *fileName,
-					      GBool deleteFile
+					      GBool deleteFile,
 #endif
-					      ) {
+					      int *codeToGID,
+					      int codeToGIDLen) {
   SplashFontFile *fontFile;
 
   fontFile = NULL;
-#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H
+#if HAVE_FREETYPE_H
   if (!fontFile && ftEngine) {
     fontFile = ftEngine->loadCIDFont(idA,
 #if LOAD_FONTS_FROM_MEM
-				     fontBuf
+				     fontBuf,
 #else
-				     fileName, deleteFile
+				     fileName, deleteFile,
 #endif
-				     );
+				     codeToGID, codeToGIDLen);
   }
 #endif
 
@@ -244,7 +246,7 @@
   SplashFontFile *fontFile;
 
   fontFile = NULL;
-#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H
+#if HAVE_FREETYPE_H
   if (!fontFile && ftEngine) {
     fontFile = ftEngine->loadOpenTypeCFFFont(idA,
 #if LOAD_FONTS_FROM_MEM
@@ -283,7 +285,7 @@
   SplashFontFile *fontFile;
 
   fontFile = NULL;
-#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H
+#if HAVE_FREETYPE_H
   if (!fontFile && ftEngine) {
     fontFile = ftEngine->loadTrueTypeFont(idA,
 #if LOAD_FONTS_FROM_MEM

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashFontEngine.h
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashFontEngine.h	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashFontEngine.h	2017-11-01 18:15:56 UTC (rev 780)
@@ -29,7 +29,7 @@
 
 #define splashFontCacheSize 16
 
-#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H
+#if HAVE_FREETYPE_H
 #define splashFTNoHinting (1 << 0)
 #endif
 
@@ -42,7 +42,7 @@
 
   // Create a font engine.
   SplashFontEngine(
-#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H
+#if HAVE_FREETYPE_H
 		   GBool enableFreeType,
 		   Guint freeTypeFlags,
 #endif
@@ -78,11 +78,11 @@
 				      const char **enc);
   SplashFontFile *loadCIDFont(SplashFontFileID *idA,
 #if LOAD_FONTS_FROM_MEM
-			      GString *fontBuf
+			      GString *fontBuf,
 #else
-			      char *fileName, GBool deleteFile
+			      char *fileName, GBool deleteFile,
 #endif
-			      );
+			      int *codeToGID, int codeToGIDLen);
   SplashFontFile *loadOpenTypeCFFFont(SplashFontFileID *idA,
 #if LOAD_FONTS_FROM_MEM
 				      GString *fontBuf,
@@ -115,7 +115,7 @@
 
   SplashFont *fontCache[splashFontCacheSize];
 
-#if HAVE_FREETYPE_FREETYPE_H || HAVE_FREETYPE_H
+#if HAVE_FREETYPE_H
   SplashFTFontEngine *ftEngine;
 #endif
 };

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashFontFile.cc
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashFontFile.cc	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashFontFile.cc	2017-11-01 18:15:56 UTC (rev 780)
@@ -16,6 +16,7 @@
 #ifndef _WIN32
 #  include <unistd.h>
 #endif
+#include "gmempp.h"
 #include "GString.h"
 #include "SplashFontFile.h"
 #include "SplashFontFileID.h"
@@ -31,6 +32,7 @@
 //------------------------------------------------------------------------
 
 SplashFontFile::SplashFontFile(SplashFontFileID *idA,
+			       SplashFontType fontTypeA,
 #if LOAD_FONTS_FROM_MEM
 			       GString *fontBufA
 #else
@@ -38,6 +40,7 @@
 #endif
 			       ) {
   id = idA;
+  fontType = fontTypeA;
 #if LOAD_FONTS_FROM_MEM
   fontBuf = fontBufA;
 #else
@@ -60,11 +63,22 @@
 }
 
 void SplashFontFile::incRefCnt() {
+#if MULTITHREADED
+  gAtomicIncrement(&refCnt);
+#else
   ++refCnt;
+#endif
 }
 
 void SplashFontFile::decRefCnt() {
-  if (!--refCnt) {
+  GBool done;
+
+#if MULTITHREADED
+  done = gAtomicDecrement(&refCnt) == 0;
+#else
+  done = --refCnt == 0;
+#endif
+  if (done) {
     delete this;
   }
 }

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashFontFile.h
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashFontFile.h	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashFontFile.h	2017-11-01 18:15:56 UTC (rev 780)
@@ -18,6 +18,10 @@
 #include "gtypes.h"
 #include "SplashTypes.h"
 
+#if MULTITHREADED
+#include "GMutex.h"
+#endif
+
 class GString;
 class SplashFontEngine;
 class SplashFont;
@@ -24,6 +28,20 @@
 class SplashFontFileID;
 
 //------------------------------------------------------------------------
+// SplashFontType
+//------------------------------------------------------------------------
+
+enum SplashFontType {
+  splashFontType1,		// GfxFontType.fontType1
+  splashFontType1C,		// GfxFontType.fontType1C
+  splashFontOpenTypeT1C,	// GfxFontType.fontType1COT
+  splashFontCID,		// GfxFontType.fontCIDType0/fontCIDType0C
+  splashFontOpenTypeCFF,	// GfxFontType.fontCIDType0COT
+  splashFontTrueType		// GfxFontType.fontTrueType/fontTrueTypeOT/
+				//             fontCIDType2/fontCIDType2OT
+};
+
+//------------------------------------------------------------------------
 // SplashFontFile
 //------------------------------------------------------------------------
 
@@ -49,6 +67,7 @@
 protected:
 
   SplashFontFile(SplashFontFileID *idA,
+		 SplashFontType fontTypeA,
 #if LOAD_FONTS_FROM_MEM
 		 GString *fontBufA
 #else
@@ -57,6 +76,7 @@
 		 );
 
   SplashFontFileID *id;
+  SplashFontType fontType;
 #if LOAD_FONTS_FROM_MEM
   GString *fontBuf;
 #else
@@ -63,7 +83,11 @@
   GString *fileName;
   GBool deleteFile;
 #endif
+#if MULTITHREADED
+  GAtomicCounter refCnt;
+#else
   int refCnt;
+#endif
 
   friend class SplashFontEngine;
 };

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashFontFileID.cc
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashFontFileID.cc	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashFontFileID.cc	2017-11-01 18:15:56 UTC (rev 780)
@@ -12,6 +12,7 @@
 #pragma implementation
 #endif
 
+#include "gmempp.h"
 #include "SplashFontFileID.h"
 
 //------------------------------------------------------------------------

Modified: branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashMath.h
===================================================================
--- branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashMath.h	2017-11-01 17:55:42 UTC (rev 779)
+++ branches/stable/source/src/libs/xpdf/xpdf-src/splash/SplashMath.h	2017-11-01 18:15:56 UTC (rev 780)
@@ -12,9 +12,13 @@
 #include <aconf.h>
 
 #if USE_FIXEDPONT
-#include "FixedPoint.h"
+#  include "FixedPoint.h"
 #else
-#include <math.h>
+#  include <math.h>
+#  if (defined(__GNUC__) && defined(__SSE2__)) || \
+      (defined(_WIN32) && (_M_IX86_FP == 2 || defined(_M_X64)))
+#    include <emmintrin.h>
+#  endif
 #endif
 #include "SplashTypes.h"
 
@@ -26,14 +30,40 @@
 #endif
 }
 
+// floor() and (int)() are implemented separately, which results
+// in changing the FPCW multiple times - so we optimize it with
+// some inline assembly or SSE intrinsics.
 static inline int splashFloor(SplashCoord x) {
 #if USE_FIXEDPOINT
+
+  //--- fixed point
+
   return FixedPoint::floor(x);
-#else
-#if __GNUC__ && __i386__
-  // floor() and (int)() are implemented separately, which results
-  // in changing the FPCW multiple times - so we optimize it with
-  // some inline assembly
+
+#elif (defined(__GNUC__) && defined(__SSE2__)) || \
+      (defined(_WIN32) && (_M_IX86_FP == 2 || defined(_M_X64)))
+
+  //--- SSE2 intrinsics
+  // NB: 64-bit x86 guarantees availability of SSE2.
+
+  __m128d m1, m2;
+  __m128i m3;
+  int s, i;
+
+  m1 = _mm_set_sd(x);		// m1 = x
+  i = _mm_cvttsd_si32(m1);	// i = trunc(x)
+  m2 = _mm_cvtsi32_sd(m1, i);	// m2 = (double)trunc(x)
+  m1 = _mm_sub_sd(m1, m2);	// m1 = x - trunc(x)
+  m3 = _mm_castpd_si128(m1); 	// m3 = m1 (as 64-bit int)
+  m3 = _mm_srli_epi64(m3, 63);	// m3 = m3 >> 63
+  s = _mm_cvtsi128_si32(m3);	// s = m3 = sign bit of x - trunc(x)
+  return i - s;			// trunc(x) - sign bit
+
+#elif defined(__GNUC__) && defined(__i386__) && !defined(__APPLE__)
+
+  //--- x87 inline assembly (gcc/clang)
+  // (this code fails on OSX for reasons I don't understand)
+
   Gushort oldCW, newCW, t;
   int result;
 

@@ Diff output truncated at 1234567 characters. @@


More information about the pdftex-commits mailing list