 configure                             |    6 +--
 configure.in                          |    6 +--
 texk/web2c/pdfetexdir/pdfetex.mk      |    5 ++
 texk/web2c/pdfetexdir/pdfetexextra.in |    2 -
 texk/web2c/pdftexdir/Makefile.in      |    2 -
 texk/web2c/pdftexdir/depend.mk        |   58 ++--------------------------------
 texk/web2c/pdftexdir/pdftex.mk        |    7 ++--
 texk/web2c/pdftexdir/pdftoepdf.cc     |   41 ++++++++++++------------
 texk/web2c/pdftexdir/pdftosrc.cc      |   36 ++++++++++-----------
 texk/web2c/pdfxtexdir/pdfxtex.mk      |    5 ++
 10 files changed, 64 insertions(+), 104 deletions(-)

Index: tetex-bin-3.0/texk/web2c/pdftexdir/depend.mk
===================================================================
--- tetex-bin-3.0.orig/texk/web2c/pdftexdir/depend.mk	2006-03-03 16:44:22.000000000 +0100
+++ tetex-bin-3.0/texk/web2c/pdftexdir/depend.mk	2006-03-24 10:16:26.000000000 +0100
@@ -1,54 +1,4 @@
-epdf.o: epdf.c ptexlib.h ../pdftexd.h ../texmfmp.h ../cpascal.h \
- ../config.h ../help.h ../texmfmem.h ../pdftexcoerce.h ptexmac.h
-mapfile.o: mapfile.c ptexlib.h ../pdftexd.h ../texmfmp.h ../cpascal.h \
- ../config.h ../help.h ../texmfmem.h ../pdftexcoerce.h ptexmac.h
-papersiz.o: papersiz.c ptexlib.h ../pdftexd.h ../texmfmp.h \
- ../cpascal.h ../config.h ../help.h ../texmfmem.h ../pdftexcoerce.h \
- ptexmac.h
-utils.o: utils.c ptexlib.h ../pdftexd.h ../texmfmp.h ../cpascal.h \
- ../config.h ../help.h ../texmfmem.h ../pdftexcoerce.h ptexmac.h \
- ../../../libs/zlib/zlib.h ../../../libs/zlib/zconf.h \
- ../../../libs/md5/md5.h pdftexextra.h
-vfpacket.o: vfpacket.c ptexlib.h ../pdftexd.h ../texmfmp.h \
- ../cpascal.h ../config.h ../help.h ../texmfmem.h ../pdftexcoerce.h \
- ptexmac.h
-pkin.o: pkin.c ptexlib.h ../pdftexd.h ../texmfmp.h ../cpascal.h \
- ../config.h ../help.h ../texmfmem.h ../pdftexcoerce.h ptexmac.h
-writefont.o: writefont.c ../../../libs/xpdf/goo/gmem.h ptexlib.h \
- ../pdftexd.h ../texmfmp.h ../cpascal.h ../config.h ../help.h \
- ../texmfmem.h ../pdftexcoerce.h ptexmac.h
-writet1.o: writet1.c ptexlib.h ../pdftexd.h ../texmfmp.h ../cpascal.h \
- ../config.h ../help.h ../texmfmem.h ../pdftexcoerce.h ptexmac.h
-writet3.o: writet3.c ptexlib.h ../pdftexd.h ../texmfmp.h ../cpascal.h \
- ../config.h ../help.h ../texmfmem.h ../pdftexcoerce.h ptexmac.h
-writezip.o: writezip.c ptexlib.h ../pdftexd.h ../texmfmp.h \
- ../cpascal.h ../config.h ../help.h ../texmfmem.h ../pdftexcoerce.h \
- ptexmac.h ../../../libs/zlib/zlib.h ../../../libs/zlib/zconf.h
-writeenc.o: writeenc.c ptexlib.h ../pdftexd.h ../texmfmp.h \
- ../cpascal.h ../config.h ../help.h ../texmfmem.h ../pdftexcoerce.h \
- ptexmac.h
-writettf.o: writettf.c ptexlib.h ../pdftexd.h ../texmfmp.h \
- ../cpascal.h ../config.h ../help.h ../texmfmem.h ../pdftexcoerce.h \
- ptexmac.h macnames.c
-writejpg.o: writejpg.c ptexlib.h ../pdftexd.h ../texmfmp.h \
- ../cpascal.h ../config.h ../help.h ../texmfmem.h ../pdftexcoerce.h \
- ptexmac.h image.h
-writepng.o: writepng.c ptexlib.h ../pdftexd.h ../texmfmp.h \
- ../cpascal.h ../config.h ../help.h ../texmfmem.h ../pdftexcoerce.h \
- ptexmac.h image.h
-writeimg.o: writeimg.c ptexlib.h ../pdftexd.h ../texmfmp.h \
- ../cpascal.h ../config.h ../help.h ../texmfmem.h ../pdftexcoerce.h \
- ptexmac.h image.h
-pdftoepdf.o: pdftoepdf.cc ../../../libs/xpdf/xpdf/Object.h \
- ../../../libs/xpdf/goo/gmem.h ../../../libs/xpdf/xpdf/Array.h \
- ../../../libs/xpdf/xpdf/Dict.h ../../../libs/xpdf/xpdf/Stream.h \
- ../../../libs/xpdf/xpdf/XRef.h ../../../libs/xpdf/xpdf/Catalog.h \
- ../../../libs/xpdf/xpdf/Page.h ../../../libs/xpdf/xpdf/GfxFont.h \
- ../../../libs/xpdf/xpdf/Error.h epdf.h
-ttf2afm.o: ttf2afm.c macnames.c
-pdftosrc.o: pdftosrc.cc ../../../libs/xpdf/xpdf/Object.h \
- ../../../libs/xpdf/xpdf/Array.h ../../../libs/xpdf/xpdf/Dict.h \
- ../../../libs/xpdf/xpdf/Stream.h ../../../libs/xpdf/xpdf/XRef.h \
- ../../../libs/xpdf/xpdf/Catalog.h ../../../libs/xpdf/xpdf/Page.h \
- ../../../libs/xpdf/xpdf/PDFDoc.h ../../../libs/xpdf/xpdf/Link.h \
- ../../../libs/xpdf/xpdf/Error.h ../../../libs/xpdf/xpdf/config.h
+pdftoepdf.o: pdftoepdf.cc epdf.h ../../kpathsea/c-auto.h \
+  ../../kpathsea/c-proto.h ../../web2c/c-auto.h ../../web2c/config.h \
+  ../../kpathsea/c-fopen.h ../../web2c/pdftexdir/ptexmac.h
+pdftosrc.o: pdftosrc.cc
Index: tetex-bin-3.0/texk/web2c/pdftexdir/pdftoepdf.cc
===================================================================
--- tetex-bin-3.0.orig/texk/web2c/pdftexdir/pdftoepdf.cc	2006-03-03 16:44:22.000000000 +0100
+++ tetex-bin-3.0/texk/web2c/pdftexdir/pdftoepdf.cc	2006-03-24 10:16:27.000000000 +0100
@@ -26,22 +26,23 @@
 #include <stdio.h>
 #include <string.h>
 #include <ctype.h>
-#include <aconf.h>
-#include <GString.h>
-#include <gmem.h>
-#include <gfile.h>
-#include <config.h>
-#include "Object.h"
-#include "Stream.h"
-#include "Array.h"
-#include "Dict.h"
-#include "XRef.h"
-#include "Catalog.h"
-#include "Page.h"
-#include "GfxFont.h"
-#include "PDFDoc.h"
-#include "GlobalParams.h"
-#include "Error.h"
+#include <dirent.h>
+#include <poppler/poppler-config.h>
+#include <poppler/goo/GooString.h>
+#include <poppler/goo/gmem.h>
+#include <poppler/goo/gfile.h>
+#include "poppler/Object.h"
+#include "poppler/Stream.h"
+#include "poppler/Array.h"
+#include "poppler/Dict.h"
+#include "poppler/XRef.h"
+#include "poppler/Link.h"
+#include "poppler/Catalog.h"
+#include "poppler/Page.h"
+#include "poppler/GfxFont.h"
+#include "poppler/PDFDoc.h"
+#include "poppler/GlobalParams.h"
+#include "poppler/Error.h"
 
 #include "epdf.h"
 
@@ -189,7 +190,7 @@
 #ifdef DEBUG
     fprintf(stderr, "\nCreating %s (%d)\n", p->file_name, p->occurences);
 #endif
-    GString *docName = new GString(p->file_name);
+    GooString *docName = new GooString(p->file_name);
     p->doc = new PDFDoc(docName);  // takes ownership of docName
     if (!p->doc->isOk() || !p->doc->okToPrint()) {
         pdftex_fail("xpdf: reading PDF image failed");
@@ -539,7 +540,7 @@
     int  i, l, c;
     Ref ref;
     char *p;
-    GString *s;
+    GooString *s;
     if (obj->isBool()) {
         pdf_printf("%s", obj->getBool() ? "true" : "false");
     }
@@ -686,7 +687,7 @@
     float pdf_version_found, pdf_version_wanted;
     // initialize
     if (!isInit) {
-        globalParams = new GlobalParams();
+        globalParams = new GlobalParams(NULL);
         globalParams->setErrQuiet(gFalse);
         isInit = gTrue;
     }
@@ -713,7 +714,7 @@
     epdf_num_pages = pdf_doc->doc->getCatalog()->getNumPages();
     if (page_name) {
         // get page by name
-        GString name(page_name);
+        GooString name(page_name);
         LinkDest *link = pdf_doc->doc->findDest(&name);
         if (link == 0 || !link->isOk())
             pdftex_fail("pdf inclusion: invalid destination <%s>",
Index: tetex-bin-3.0/texk/web2c/pdftexdir/pdftosrc.cc
===================================================================
--- tetex-bin-3.0.orig/texk/web2c/pdftexdir/pdftosrc.cc	2006-03-03 16:44:22.000000000 +0100
+++ tetex-bin-3.0/texk/web2c/pdftexdir/pdftosrc.cc	2006-03-24 10:16:27.000000000 +0100
@@ -25,21 +25,21 @@
 #include <stdio.h>
 #include <string.h>
 #include <ctype.h>
-#include <aconf.h>
-#include <GString.h>
-#include <gmem.h>
-#include <gfile.h>
-#include "Object.h"
-#include "Stream.h"
-#include "Array.h"
-#include "Dict.h"
-#include "XRef.h"
-#include "Catalog.h"
-#include "Page.h"
-#include "GfxFont.h"
-#include "PDFDoc.h"
-#include "GlobalParams.h"
-#include "Error.h"
+#include <dirent.h>
+#include <poppler/goo/GooString.h>
+#include <poppler/goo/gmem.h>
+#include <poppler/goo/gfile.h>
+#include "poppler/Object.h"
+#include "poppler/Stream.h"
+#include "poppler/Array.h"
+#include "poppler/Dict.h"
+#include "poppler/XRef.h"
+#include "poppler/Catalog.h"
+#include "poppler/Page.h"
+#include "poppler/GfxFont.h"
+#include "poppler/PDFDoc.h"
+#include "poppler/GlobalParams.h"
+#include "poppler/Error.h"
 
 static XRef *xref = 0;
 
@@ -47,7 +47,7 @@
 {
     char *p, buf[1024];
     PDFDoc *doc;
-    GString *fileName;
+    GooString *fileName;
     Stream *s;
     Object srcStream, srcName, catalogDict;
     FILE *outfile;
@@ -59,8 +59,8 @@
         fprintf(stderr, "Usage: pdftosrc <PDF-file> [<stream-object-number>]\n");
         exit(1);
     }
-    fileName = new GString(argv[1]);
-    globalParams = new GlobalParams();
+    fileName = new GooString(argv[1]);
+    globalParams = new GlobalParams(NULL);
     doc = new PDFDoc(fileName);
     if (!doc->isOk()) {
         fprintf(stderr, "Invalid PDF file\n");
Index: tetex-bin-3.0/configure
===================================================================
--- tetex-bin-3.0.orig/configure	2006-03-24 10:16:26.000000000 +0100
+++ tetex-bin-3.0/configure	2006-03-24 10:16:27.000000000 +0100
@@ -3292,9 +3292,9 @@
 
 # we need libxpdf for pdf[ex]tex
 test ! -d $srcdir/$LIBXPDFDIR && : ${needs_libxpdf=no}
-test "$with_pdftex"  != no    && : ${needs_libxpdf=yes}
-test "$with_pdfetex"  != no    && : ${needs_libxpdf=yes}
-test "$with_pdfxtex"  != no    && : ${needs_libxpdf=yes}
+test "$with_pdftex"  != no    && : ${needs_libxpdf=no}
+test "$with_pdfetex"  != no    && : ${needs_libxpdf=no}
+test "$with_pdfxtex"  != no    && : ${needs_libxpdf=no}
 : ${needs_libxpdf=no}
 export needs_libxpdf
 
Index: tetex-bin-3.0/configure.in
===================================================================
--- tetex-bin-3.0.orig/configure.in	2006-03-03 16:44:22.000000000 +0100
+++ tetex-bin-3.0/configure.in	2006-03-24 10:16:27.000000000 +0100
@@ -145,9 +145,9 @@
 
 # we need libxpdf for pdf[ex]tex
 test ! -d $srcdir/$LIBXPDFDIR && : ${needs_libxpdf=no}
-test "$with_pdftex"  != no    && : ${needs_libxpdf=yes}
-test "$with_pdfetex"  != no    && : ${needs_libxpdf=yes}
-test "$with_pdfxtex"  != no    && : ${needs_libxpdf=yes}
+test "$with_pdftex"  != no    && : ${needs_libxpdf=no}
+test "$with_pdfetex"  != no    && : ${needs_libxpdf=no}
+test "$with_pdfxtex"  != no    && : ${needs_libxpdf=no}
 : ${needs_libxpdf=no}
 export needs_libxpdf
 
Index: tetex-bin-3.0/texk/web2c/pdftexdir/Makefile.in
===================================================================
--- tetex-bin-3.0.orig/texk/web2c/pdftexdir/Makefile.in	2006-03-03 16:44:22.000000000 +0100
+++ tetex-bin-3.0/texk/web2c/pdftexdir/Makefile.in	2006-03-24 10:16:27.000000000 +0100
@@ -8,7 +8,7 @@
 kpathsea_srcdir_parent = $(srcdir)/../..
 kpathsea_dir_parent = ../..
 
-ALL_CXXFLAGS = @CXXFLAGS@ @DEFS@ $(XXCFLAGS) -I. -I$(srcdir) -I$(kpathsea_dir_parent) -I$(kpathsea_srcdir_parent) @LIBXPDFCPPFLAGS@
+ALL_CXXFLAGS = @CXXFLAGS@ @DEFS@ $(XXCFLAGS) -I. -I$(srcdir) -I$(kpathsea_dir_parent) -I$(kpathsea_srcdir_parent) -I/usr/include/poppler
 CXX = @CXX@
 
 .SUFFIXES: .cc .o
Index: tetex-bin-3.0/texk/web2c/pdftexdir/pdftex.mk
===================================================================
--- tetex-bin-3.0.orig/texk/web2c/pdftexdir/pdftex.mk	2006-03-03 16:44:22.000000000 +0100
+++ tetex-bin-3.0/texk/web2c/pdftexdir/pdftex.mk	2006-03-24 10:16:27.000000000 +0100
@@ -13,6 +13,9 @@
 pdftex_bin = pdftex pdfetex pdfxtex ttf2afm pdftosrc
 linux_build_dir = $(HOME)/pdftex/build/linux/texk/web2c
 
+# use libpoppler instead of included xpdf code
+ADDLDFLAGS = -lpoppler
+
 # We build pdftex
 pdftex = @PTEX@ pdftex
 pdftexdir = pdftexdir
@@ -29,7 +32,7 @@
 
 # Making pdftex
 pdftex: $(pdftex_o) $(pdftexextra_o) $(pdftexlibsdep)
-	@CXXHACKLINK@ $(pdftex_o) $(pdftexextra_o) $(pdftexlibs) $(socketlibs) @CXXHACKLDLIBS@ @CXXLDEXTRA@
+	@CXXHACKLINK@ $(pdftex_o) $(pdftexextra_o) $(pdftexlibs) $(socketlibs) @CXXHACKLDLIBS@ @CXXLDEXTRA@ $(ADDLDFLAGS)
 
 # C file dependencies.
 $(pdftex_c) pdftexcoerce.h pdftexd.h: pdftex.p $(web2c_texmf)
@@ -153,7 +156,7 @@
 pdftosrc = pdftosrc
 
 pdftosrc: pdftexdir/pdftosrc.o $(LIBXPDFDEP)
-	@CXXHACKLINK@ pdftexdir/pdftosrc.o $(LDLIBXPDF) -lm @CXXLDEXTRA@
+	@CXXHACKLINK@ pdftexdir/pdftosrc.o $(LDLIBXPDF) -lm @CXXLDEXTRA@ $(ADDLDFLAGS)
 pdftexdir/pdftosrc.o:$(srcdir)/pdftexdir/pdftosrc.cc
 	cd pdftexdir && $(MAKE) pdftosrc.o
 check: pdftosrc-check
Index: tetex-bin-3.0/texk/web2c/pdfetexdir/pdfetex.mk
===================================================================
--- tetex-bin-3.0.orig/texk/web2c/pdfetexdir/pdfetex.mk	2006-03-03 16:44:22.000000000 +0100
+++ tetex-bin-3.0/texk/web2c/pdfetexdir/pdfetex.mk	2006-03-24 10:16:27.000000000 +0100
@@ -8,13 +8,16 @@
 pdfetex = @PETEX@ pdfetex
 pdfetexdir = pdfetexdir
 
+# use libpoppler instead of included xpdf code
+ADDLDFLAGS = -lpoppler
+
 # The C sources.
 pdfetex_c = pdfetexini.c pdfetex0.c pdfetex1.c pdfetex2.c pdfetex3.c
 pdfetex_o = pdfetexini.o pdfetex0.o pdfetex1.o pdfetex2.o pdfetex3.o pdfetexextra.o
 
 # Making pdfetex
 pdfetex: pdftexd.h $(pdfetex_o) $(pdfetexextra_o) $(pdftexlibsdep)
-	@CXXHACKLINK@ $(pdfetex_o) $(pdfetexextra_o) $(pdftexlibs) $(socketlibs) @CXXHACKLDLIBS@ @CXXLDEXTRA@
+	@CXXHACKLINK@ $(pdfetex_o) $(pdfetexextra_o) $(pdftexlibs) $(socketlibs) @CXXHACKLDLIBS@ @CXXLDEXTRA@ $(ADDLDFLAGS)
 
 # C file dependencies.
 $(pdfetex_c) pdfetexcoerce.h pdfetexd.h: pdfetex.p $(web2c_texmf)
Index: tetex-bin-3.0/texk/web2c/pdfxtexdir/pdfxtex.mk
===================================================================
--- tetex-bin-3.0.orig/texk/web2c/pdfxtexdir/pdfxtex.mk	2006-03-03 16:44:22.000000000 +0100
+++ tetex-bin-3.0/texk/web2c/pdfxtexdir/pdfxtex.mk	2006-03-24 10:16:27.000000000 +0100
@@ -8,13 +8,16 @@
 pdfxtex = @PXTEX@ pdfxtex
 pdfxtexdir = pdfxtexdir
 
+# use libpoppler instead of included xpdf code
+ADDLDFLAGS = -lpoppler
+
 # The C sources.
 pdfxtex_c = pdfxtexini.c pdfxtex0.c pdfxtex1.c pdfxtex2.c pdfxtex3.c
 pdfxtex_o = pdfxtexini.o pdfxtex0.o pdfxtex1.o pdfxtex2.o pdfxtex3.o pdfxtexextra.o
 
 # Making pdfxtex
 pdfxtex: pdftexd.h $(pdfxtex_o) $(pdfxtexextra_o) $(pdftexlibsdep)
-	@CXXHACKLINK@ $(pdfxtex_o) $(pdfxtexextra_o) $(pdftexlibs) $(socketlibs) @CXXHACKLDLIBS@ @CXXLDEXTRA@
+	@CXXHACKLINK@ $(pdfxtex_o) $(pdfxtexextra_o) $(pdftexlibs) $(socketlibs) @CXXHACKLDLIBS@ @CXXLDEXTRA@ $(ADDLDFLAGS)
 
 # C file dependencies.
 $(pdfxtex_c) pdfxtexcoerce.h pdfxtexd.h: pdfxtex.p $(web2c_texmf) pdfxtexdir/pdfxtex.defines
Index: tetex-bin-3.0/texk/web2c/pdfetexdir/pdfetexextra.in
===================================================================
--- tetex-bin-3.0.orig/texk/web2c/pdfetexdir/pdfetexextra.in	2005-07-20 12:28:21.000000000 +0200
+++ tetex-bin-3.0/texk/web2c/pdfetexdir/pdfetexextra.in	2006-03-24 10:17:29.000000000 +0100
@@ -26,7 +26,7 @@
    (generated from ../lib/texmfmp.c).
 */
 
-#define BANNER "This is pdfeTeX, Version 3.141592-PDFTEX-VERSION-ETEX-VERSION"
+#define BANNER "This is pdfeTeX using libpoppler, Version 3.141592-PDFTEX-VERSION-ETEX-VERSION"
 #define COPYRIGHT_HOLDER "Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX)"
 #define AUTHOR NULL
 #define PROGRAM_HELP PDFETEXHELP
