]>
Commit | Line | Data |
---|---|---|
768e5264 AM |
1 | diff -up texlive-2007/texk/web2c/pdftexdir/pdftex.mk.poppler texlive-2007/texk/web2c/pdftexdir/pdftex.mk |
2 | --- texlive-2007/texk/web2c/pdftexdir/pdftex.mk.poppler 2006-12-27 00:37:34.000000000 +0100 | |
3 | +++ texlive-2007/texk/web2c/pdftexdir/pdftex.mk 2007-11-28 11:53:15.000000000 +0100 | |
4 | @@ -2,6 +2,9 @@ | |
5 | # This fragment contains the parts of the makefile that are most likely to | |
6 | # differ between releases of pdfeTeX. | |
7 | ||
8 | +# use libpoppler instead of included xpdf code | |
9 | +ADDLDFLAGS = -lpoppler | |
10 | + | |
11 | # We build pdftex | |
12 | pdftex = @PETEX@ pdftex | |
13 | pdftexdir = pdftexdir | |
14 | @@ -29,7 +32,7 @@ pdftex_o = pdftexini.o pdftex0.o pdftex1 | |
15 | ||
16 | # Making pdftex | |
17 | pdftex: pdftexd.h $(pdftex_o) $(pdftexextra_o) $(pdftexlibsdep) | |
18 | - @CXXHACKLINK@ $(pdftex_o) $(pdftexextra_o) $(pdftexlibs) $(socketlibs) @CXXHACKLDLIBS@ @CXXLDEXTRA@ | |
19 | + @CXXHACKLINK@ $(pdftex_o) $(pdftexextra_o) $(pdftexlibs) $(socketlibs) @CXXHACKLDLIBS@ @CXXLDEXTRA@ $(ADDLDFLAGS) | |
20 | ||
21 | # C file dependencies. | |
22 | $(pdftex_c) pdftexcoerce.h pdftexd.h: pdftex.p $(web2c_texmf) $(srcdir)/$(pdftexdir)/pdftex.defines $(srcdir)/$(pdftexdir)/pdftex.h | |
23 | @@ -156,7 +159,7 @@ ttf2afm-clean: | |
24 | pdftosrc = pdftosrc | |
25 | ||
26 | pdftosrc: $(pdftexdir)/pdftosrc.o $(LIBXPDFDEP) | |
27 | - @CXXHACKLINK@ $(pdftexdir)/pdftosrc.o $(LDLIBXPDF) -lm @CXXLDEXTRA@ | |
28 | + @CXXHACKLINK@ $(pdftexdir)/pdftosrc.o $(LDLIBXPDF) -lm @CXXLDEXTRA@ $(ADDLDFLAGS) | |
29 | $(pdftexdir)/pdftosrc.o:$(srcdir)/$(pdftexdir)/pdftosrc.cc | |
30 | cd $(pdftexdir) && $(MAKE) pdftosrc.o | |
31 | check: pdftosrc-check | |
32 | diff -up texlive-2007/texk/web2c/pdftexdir/pdftoepdf.cc.poppler texlive-2007/texk/web2c/pdftexdir/pdftoepdf.cc | |
33 | --- texlive-2007/texk/web2c/pdftexdir/pdftoepdf.cc.poppler 2006-12-27 00:37:34.000000000 +0100 | |
34 | +++ texlive-2007/texk/web2c/pdftexdir/pdftoepdf.cc 2007-11-28 11:53:15.000000000 +0100 | |
35 | @@ -26,25 +26,24 @@ $Id: pdftoepdf.cc,v 1.9 2006/09/01 18:06 | |
36 | #include <stdio.h> | |
37 | #include <string.h> | |
38 | #include <ctype.h> | |
39 | -#include <aconf.h> | |
40 | -#include <GString.h> | |
41 | -#include <gmem.h> | |
42 | -#include <gfile.h> | |
43 | -#include <config.h> | |
44 | #include <assert.h> | |
45 | -#include "Object.h" | |
46 | -#include "Stream.h" | |
47 | -#include "Array.h" | |
48 | -#include "Dict.h" | |
49 | -#include "XRef.h" | |
50 | -#include "Catalog.h" | |
51 | -#include "Link.h" | |
52 | -#include "Page.h" | |
53 | -#include "GfxFont.h" | |
54 | -#include "PDFDoc.h" | |
55 | -#include "GlobalParams.h" | |
56 | -#include "Error.h" | |
57 | - | |
58 | +#include <dirent.h> | |
59 | +#include <poppler/poppler-config.h> | |
60 | +#include <poppler/goo/GooString.h> | |
61 | +#include <poppler/goo/gmem.h> | |
62 | +#include <poppler/goo/gfile.h> | |
63 | +#include "poppler/Object.h" | |
64 | +#include "poppler/Stream.h" | |
65 | +#include "poppler/Array.h" | |
66 | +#include "poppler/Dict.h" | |
67 | +#include "poppler/XRef.h" | |
68 | +#include "poppler/Link.h" | |
69 | +#include "poppler/Catalog.h" | |
70 | +#include "poppler/Page.h" | |
71 | +#include "poppler/GfxFont.h" | |
72 | +#include "poppler/PDFDoc.h" | |
73 | +#include "poppler/GlobalParams.h" | |
74 | +#include "poppler/Error.h" | |
75 | #include "epdf.h" | |
76 | ||
77 | // This file is mostly C and not very much C++; it's just used to interface | |
78 | @@ -169,7 +168,7 @@ static PdfDocument *find_add_document(ch | |
79 | fprintf(stderr, "\npdfTeX Debug: Creating %s (%d)\n", p->file_name, | |
80 | p->occurences); | |
81 | #endif | |
82 | - GString *docName = new GString(p->file_name); | |
83 | + GooString *docName = new GooString(p->file_name); | |
84 | p->doc = new PDFDoc(docName); // takes ownership of docName | |
85 | if (!p->doc->isOk() || !p->doc->okToPrint()) { | |
86 | pdftex_fail("xpdf: reading PDF image failed"); | |
87 | @@ -511,7 +510,7 @@ static void copyObject(Object * obj) | |
88 | int i, l, c; | |
89 | Ref ref; | |
90 | char *p; | |
91 | - GString *s; | |
92 | + GooString *s; | |
93 | if (obj->isBool()) { | |
94 | pdf_printf("%s", obj->getBool()? "true" : "false"); | |
95 | } else if (obj->isInt()) { | |
96 | @@ -703,7 +702,7 @@ read_pdf_info(char *image_name, char *pa | |
97 | epdf_num_pages = pdf_doc->doc->getCatalog()->getNumPages(); | |
98 | if (page_name) { | |
99 | // get page by name | |
100 | - GString name(page_name); | |
101 | + GooString name(page_name); | |
102 | LinkDest *link = pdf_doc->doc->findDest(&name); | |
103 | if (link == 0 || !link->isOk()) | |
104 | pdftex_fail("PDF inclusion: invalid destination <%s>", page_name); | |
105 | diff -up texlive-2007/texk/web2c/pdftexdir/pdftexextra.in.poppler texlive-2007/texk/web2c/pdftexdir/pdftexextra.in | |
106 | --- texlive-2007/texk/web2c/pdftexdir/pdftexextra.in.poppler 2006-12-27 00:37:34.000000000 +0100 | |
107 | +++ texlive-2007/texk/web2c/pdftexdir/pdftexextra.in 2007-11-28 11:53:15.000000000 +0100 | |
108 | @@ -26,7 +26,7 @@ $Id: pdftexextra.in,v 1.4 2004/08/26 18: | |
109 | (generated from ../lib/texmfmp.c). | |
110 | */ | |
111 | ||
112 | -#define BANNER "This is pdfTeX, Version 3.141592-PDFTEX-VERSION-ETEX-VERSION" | |
113 | +#define BANNER "This is pdfTeX using libpoppler, Version 3.141592-PDFTEX-VERSION-ETEX-VERSION" | |
114 | #define COPYRIGHT_HOLDER "Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX)" | |
115 | #define AUTHOR NULL | |
116 | #define PROGRAM_HELP PDFTEXHELP | |
117 | diff -up texlive-2007/texk/web2c/pdftexdir/pdftosrc.cc.poppler texlive-2007/texk/web2c/pdftexdir/pdftosrc.cc | |
118 | --- texlive-2007/texk/web2c/pdftexdir/pdftosrc.cc.poppler 2006-12-27 00:37:34.000000000 +0100 | |
119 | +++ texlive-2007/texk/web2c/pdftexdir/pdftosrc.cc 2007-11-28 12:03:48.000000000 +0100 | |
120 | @@ -25,22 +25,23 @@ $Id: //depot/Build/source.development/Te | |
121 | #include <stdio.h> | |
122 | #include <string.h> | |
123 | #include <ctype.h> | |
124 | -#include <aconf.h> | |
125 | #include <assert.h> | |
126 | -#include <GString.h> | |
127 | -#include <gmem.h> | |
128 | -#include <gfile.h> | |
129 | -#include "Object.h" | |
130 | -#include "Stream.h" | |
131 | -#include "Array.h" | |
132 | -#include "Dict.h" | |
133 | -#include "XRef.h" | |
134 | -#include "Catalog.h" | |
135 | -#include "Page.h" | |
136 | -#include "GfxFont.h" | |
137 | -#include "PDFDoc.h" | |
138 | -#include "GlobalParams.h" | |
139 | -#include "Error.h" | |
140 | + | |
141 | +#include <dirent.h> | |
142 | +#include <poppler/goo/GooString.h> | |
143 | +#include <poppler/goo/gmem.h> | |
144 | +#include <poppler/goo/gfile.h> | |
145 | +#include <poppler/Object.h> | |
146 | +#include <poppler/Stream.h> | |
147 | +#include <poppler/Array.h> | |
148 | +#include <poppler/Dict.h> | |
149 | +#include <poppler/XRef.h> | |
150 | +#include <poppler/Catalog.h> | |
151 | +#include <poppler/Page.h> | |
152 | +#include <poppler/GfxFont.h> | |
153 | +#include <poppler/PDFDoc.h> | |
154 | +#include <poppler/GlobalParams.h> | |
155 | +#include <poppler/Error.h> | |
156 | ||
157 | static XRef *xref = 0; | |
158 | ||
159 | @@ -48,7 +49,7 @@ int main(int argc, char *argv[]) | |
160 | { | |
161 | char *p, buf[1024]; | |
162 | PDFDoc *doc; | |
163 | - GString *fileName; | |
164 | + GooString *fileName; | |
165 | Stream *s; | |
166 | Object srcStream, srcName, catalogDict; | |
167 | FILE *outfile; | |
168 | @@ -62,7 +63,7 @@ int main(int argc, char *argv[]) | |
169 | "Usage: pdftosrc <PDF-file> [<stream-object-number>]\n"); | |
170 | exit(1); | |
171 | } | |
172 | - fileName = new GString(argv[1]); | |
173 | + fileName = new GooString(argv[1]); | |
174 | globalParams = new GlobalParams(); | |
175 | doc = new PDFDoc(fileName); | |
176 | if (!doc->isOk()) { | |
177 | diff -up texlive-2007/texk/web2c/pdftexdir/utils.c.poppler texlive-2007/texk/web2c/pdftexdir/utils.c | |
178 | --- texlive-2007/texk/web2c/pdftexdir/utils.c.poppler 2007-01-01 18:20:03.000000000 +0100 | |
179 | +++ texlive-2007/texk/web2c/pdftexdir/utils.c 2007-11-28 11:53:15.000000000 +0100 | |
180 | @@ -37,7 +39,7 @@ $Id: //depot/Build/source.development/Te | |
181 | #include "zlib.h" | |
182 | #include "ptexlib.h" | |
183 | #include "png.h" | |
184 | -#include "xpdf/config.h" /* just to get the xpdf version */ | |
185 | +#include "poppler/poppler-config.h" /* just to get the xpdf version */ | |
186 | ||
187 | #define check_nprintf(size_get, size_want) \ | |
188 | if ((unsigned)(size_get) >= (unsigned)(size_want)) \ | |
189 | @@ -1261,7 +1263,7 @@ void initversionstring(char **versions) | |
190 | (void) asprintf(versions, | |
191 | "Compiled with libpng %s; using libpng %s\n" | |
192 | "Compiled with zlib %s; using zlib %s\n" | |
193 | - "Compiled with xpdf version %s\n", | |
194 | + "Compiled with libpoppler version %s\n", | |
195 | PNG_LIBPNG_VER_STRING, png_libpng_ver, | |
196 | ZLIB_VERSION, zlib_version, xpdfVersion); | |
197 | } | |
198 | diff -up texlive-2007/texk/web2c/xetexdir/pdfimage.cpp.poppler texlive-2007/texk/web2c/xetexdir/pdfimage.cpp | |
199 | --- texlive-2007/texk/web2c/xetexdir/pdfimage.cpp.poppler 2006-12-09 11:29:12.000000000 +0100 | |
200 | +++ texlive-2007/texk/web2c/xetexdir/pdfimage.cpp 2007-11-28 11:53:15.000000000 +0100 | |
201 | @@ -11,10 +11,24 @@ | |
202 | ||
203 | #include "pdfimage.h" | |
204 | ||
205 | -#include "PDFDoc.h" | |
206 | -#include "Catalog.h" | |
207 | -#include "Page.h" | |
208 | -#include "GString.h" | |
209 | +#include <dirent.h> | |
210 | +#include <poppler/poppler-config.h> | |
211 | +#include <poppler/goo/GooString.h> | |
212 | +#include <poppler/goo/gmem.h> | |
213 | +#include <poppler/goo/gfile.h> | |
214 | +#include "poppler/Object.h" | |
215 | +#include "poppler/Stream.h" | |
216 | +#include "poppler/Array.h" | |
217 | +#include "poppler/Dict.h" | |
218 | +#include "poppler/XRef.h" | |
219 | +#include "poppler/Link.h" | |
220 | +#include "poppler/Catalog.h" | |
221 | +#include "poppler/Page.h" | |
222 | +#include "poppler/GfxFont.h" | |
223 | +#include "poppler/PDFDoc.h" | |
224 | +#include "poppler/GlobalParams.h" | |
225 | +#include "poppler/Error.h" | |
226 | + | |
227 | ||
228 | #include "XeTeX_ext.h" | |
229 | ||
230 | @@ -28,7 +42,7 @@ my_fmin(double x, double y) | |
231 | int | |
232 | pdf_get_rect(char* filename, int page_num, int pdf_box, realrect* box) | |
233 | { | |
234 | - GString* name = new GString(filename); | |
235 | + GooString* name = new GooString(filename); | |
236 | PDFDoc* doc = new PDFDoc(name); | |
237 | ||
238 | if (!doc) { | |
239 | diff -up texlive-2007/texk/web2c/xetexdir/XeTeX_ext.c.poppler texlive-2007/texk/web2c/xetexdir/XeTeX_ext.c | |
240 | --- texlive-2007/texk/web2c/xetexdir/XeTeX_ext.c.poppler 2007-01-15 14:04:36.000000000 +0100 | |
241 | +++ texlive-2007/texk/web2c/xetexdir/XeTeX_ext.c 2007-11-28 11:53:15.000000000 +0100 | |
242 | @@ -33,7 +33,7 @@ authorization from SIL International. | |
243 | */ | |
244 | ||
245 | #ifdef XETEX_OTHER | |
246 | -#include "xpdf/config.h" | |
247 | +#include "poppler/poppler-config.h" | |
248 | #include "png.h" | |
249 | #endif | |
250 | ||
251 | @@ -194,7 +194,7 @@ void initversionstring(char **versions) | |
252 | #else | |
253 | "Compiled with fontconfig version %d.%d.%d; using %d.%d.%d\n" | |
254 | "Compiled with libpng version %s; using %s\n" | |
255 | - "Compiled with xpdf version %s\n" | |
256 | + "Compiled with libpoppler version %s\n" | |
257 | #endif | |
258 | ; | |
259 | ||
260 | diff -up texlive-2007/texk/web2c/xetexdir/xetex.mk.poppler texlive-2007/texk/web2c/xetexdir/xetex.mk | |
261 | --- texlive-2007/texk/web2c/xetexdir/xetex.mk.poppler 2007-11-28 11:53:15.000000000 +0100 | |
262 | +++ texlive-2007/texk/web2c/xetexdir/xetex.mk 2007-11-28 11:53:15.000000000 +0100 | |
263 | @@ -4,6 +4,10 @@ | |
264 | ||
265 | Makefile: $(srcdir)/xetexdir/xetex.mk | |
266 | ||
267 | +# use libpoppler instead of included xpdf code | |
268 | +ADDLDFLAGS = -lpoppler | |
269 | + | |
270 | + | |
271 | # We build xetex unless configure decides to skip it | |
272 | xetex = @XETEX@ xetex | |
273 | ||
274 | @@ -29,7 +33,7 @@ xetex = @XETEX@ xetex | |
275 | ||
276 | @XETEX_GENERIC@ XETEX_DEFINES = -DXETEX_OTHER | |
277 | ||
278 | -@XETEX_GENERIC@ EXTRALIBS = @LDLIBXPDF@ @LDLIBPNG@ @LDFONTCONFIG@ | |
279 | +@XETEX_GENERIC@ EXTRALIBS = @LDLIBXPDF@ @LDLIBPNG@ @LDFONTCONFIG@ $(ADDLDFLAGS) | |
280 | ||
281 | @XETEX_GENERIC@ EXTRADEPS = @LIBXPDFDEP@ @LIBPNGDEP@ | |
282 | ||
283 | @@ -144,7 +148,7 @@ pngimage.o: $(srcdir)/xetexdir/pngimage. | |
284 | $(compile) $(ALL_CFLAGS) $(LIBPNGCPPFLAGS) $(ZLIBCPPFLAGS) -c $< -o $@ | |
285 | ||
286 | pdfimage.o: $(srcdir)/xetexdir/pdfimage.cpp $(srcdir)/xetexdir/pdfimage.h | |
287 | - $(CXX) $(ALL_CFLAGS) $(LIBXPDFCPPFLAGS) -c $< -o $@ | |
288 | + $(CXX) $(ALL_CFLAGS) $(LIBXPDFCPPFLAGS) -I/usr/include/poppler -c $< -o $@ | |
289 | ||
290 | XeTeX_pic.o: $(srcdir)/xetexdir/XeTeX_pic.c $(srcdir)/xetexdir/XeTeX_ext.h $(XeTeXImageHdrs) | |
291 | $(compile) $(TECKITFLAGS) $(ALL_CFLAGS) $(XETEX_DEFINES) -c $< -o $@ | |
292 | @@ -187,7 +191,7 @@ XeTeXOTMath.o: $(srcdir)/xetexdir/XeTeXO | |
293 | ||
294 | # special rules for files that need the TECkit headers as well | |
295 | XeTeX_ext.o: $(srcdir)/xetexdir/XeTeX_ext.c xetexd.h | |
296 | - $(compile) $(ICUCFLAGS) $(FTFLAGS) $(TECKITFLAGS) $(LIBPNGCPPFLAGS) $(LIBXPDFCPPFLAGS) $(ZLIBCPPFLAGS) $(ALL_CFLAGS) $(XETEX_DEFINES) -c $< -o $@ | |
297 | + $(compile) $(ICUCFLAGS) $(FTFLAGS) $(TECKITFLAGS) $(LIBPNGCPPFLAGS) $(LIBXPDFCPPFLAGS) $(ZLIBCPPFLAGS) $(ALL_CFLAGS) $(XETEX_DEFINES) -I/usr/include/poppler -c $< -o $@ | |
298 | XeTeX_mac.o: $(srcdir)/xetexdir/XeTeX_mac.c xetexd.h | |
299 | $(compile) $(ICUCFLAGS) $(TECKITFLAGS) $(ALL_CFLAGS) $(XETEX_DEFINES) -c $< -o $@ | |
300 | ||
301 | diff -up texlive-2007/configure.poppler texlive-2007/configure | |
302 | --- texlive-2007/configure.poppler 2007-01-09 15:16:26.000000000 +0100 | |
303 | +++ texlive-2007/configure 2007-11-28 11:53:15.000000000 +0100 | |
304 | @@ -3442,9 +3442,9 @@ export needs_zlib | |
305 | ||
306 | # we need libxpdf for pdf[ex]tex, xetex | |
307 | test ! -d $srcdir/$LIBXPDFDIR && : ${needs_libxpdf=no} | |
308 | -test "$with_pdftex" != no && : ${needs_libxpdf=yes} | |
309 | -test "$with_pdfetex" != no && : ${needs_libxpdf=yes} | |
310 | -test "$with_xetex" != no && : ${needs_libxpdf=yes} | |
311 | +test "$with_pdftex" != no && : ${needs_libxpdf=no} | |
312 | +test "$with_pdfetex" != no && : ${needs_libxpdf=no} | |
313 | +test "$with_xetex" != no && : ${needs_libxpdf=no} | |
314 | : ${needs_libxpdf=no} | |
315 | export needs_libxpdf | |
316 | ||
317 | diff -up texlive-2007/configure.in.poppler texlive-2007/configure.in | |
318 | --- texlive-2007/configure.in.poppler 2007-01-09 02:17:11.000000000 +0100 | |
319 | +++ texlive-2007/configure.in 2007-11-28 11:53:15.000000000 +0100 | |
320 | @@ -157,9 +157,9 @@ export needs_zlib | |
321 | ||
322 | # we need libxpdf for pdf[ex]tex, xetex | |
323 | test ! -d $srcdir/$LIBXPDFDIR && : ${needs_libxpdf=no} | |
324 | -test "$with_pdftex" != no && : ${needs_libxpdf=yes} | |
325 | -test "$with_pdfetex" != no && : ${needs_libxpdf=yes} | |
326 | -test "$with_xetex" != no && : ${needs_libxpdf=yes} | |
327 | +test "$with_pdftex" != no && : ${needs_libxpdf=no} | |
328 | +test "$with_pdfetex" != no && : ${needs_libxpdf=no} | |
329 | +test "$with_xetex" != no && : ${needs_libxpdf=no} | |
330 | : ${needs_libxpdf=no} | |
331 | export needs_libxpdf | |
332 | ||
333 | @@ -207,7 +207,7 @@ dnl We cannot use variables (e.g. $LIBPN | |
334 | sinclude(libs/libpng/libpng.ac) | |
335 | sinclude(libs/zlib/zlib.ac) | |
336 | sinclude(libs/ncurses/ncurses.ac) | |
337 | -sinclude(libs/xpdf/libxpdf.ac) | |
338 | +#sinclude(libs/xpdf/libxpdf.ac) | |
339 | sinclude(libs/t1lib/t1lib.ac) | |
340 | sinclude(libs/gd/gd.ac) | |
341 | sinclude(libs/freetype/freetype.ac) |