From d41e3dfe99bfc6e1ee92831be3257e8bab412711 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Asbj=C3=B8rn=20Sloth=20T=C3=B8nnesen?= Date: Mon, 7 Jun 2010 19:27:25 +0000 Subject: [PATCH] poppler: re-enable poppler in the build system --- configure.in | 48 ++++++++++++++++++++++++++++-------------------- lib/pdf/Makefile.in | 26 ++++++++++++++------------ 2 files changed, 42 insertions(+), 32 deletions(-) diff --git a/configure.in b/configure.in index 9cc3f23..fd70293 100644 --- a/configure.in +++ b/configure.in @@ -14,6 +14,7 @@ CHECKMEM= PROFILING= ENABLE_WARNINGS= OPTIMIZE= +USE_POPPLER= DISABLE_LAME= AC_ARG_ENABLE(checkmem, @@ -26,6 +27,8 @@ AC_ARG_ENABLE(warnings, [ --enable-warnings turn on compiler warnings], ENABLE_WARNINGS=true) AC_ARG_ENABLE(optimizations, [ --enable-optimizations turn on compiler optimizations (recommended for avi2swf)], OPTIMIZE=true) +AC_ARG_ENABLE(poppler, +[ --enable-poppler link againist libpoppler], USE_POPPLER=true) AC_ARG_ENABLE(lame, [ --disable-lame "don't compile any L.A.M.E. mp3 encoding code in"], @@ -322,29 +325,33 @@ else fi AC_SUBST(lame_in_source) -splash_in_source='$(splash_objects)' -xpdf_in_source='$(xpdf_objects)' - -dnl if test "x$USE_POPPLER" = "xtrue"; then -dnl xpdf_in_source= -dnl splash_in_source= -dnl AC_DEFINE([HAVE_POPPLER],[1],[use poppler]) -dnl PKG_CHECK_MODULES([POPPLER],[poppler poppler-splash],,[poppler_pkgconfig=no]) -dnl if test "x$poppler_pkgconfig" = "xno"; then -dnl AC_LANG_PUSH([C++]) -dnl AC_CHECK_HEADERS([OutputDev.h],[ -dnl AC_CHECK_LIB([poppler],[main],,[]) -dnl ],[AC_MSG_ERROR([No poppler library found. This library is required.])]) -dnl AC_LANG_POP -dnl else -dnl CPPFLAGS="$CPPFLAGS $POPPLER_CFLAGS" -dnl AC_DEFINE([HAVE_POPPLER], [1]) -dnl LIBS="$LIBS $POPPLER_LIBS" -dnl fi -dnl fi +xpdf_in_source= +splash_in_source= +xpdf_include= + +if test "x$USE_POPPLER" = "xtrue"; then + AC_DEFINE([HAVE_POPPLER],[1],[use poppler]) + PKG_CHECK_MODULES([POPPLER],[poppler poppler-splash],,[poppler_pkgconfig=no]) + if test "x$poppler_pkgconfig" = "xno"; then + AC_LANG_PUSH([C++]) + AC_CHECK_HEADERS([OutputDev.h],[ + AC_CHECK_LIB([poppler],[main],,[]) + ],[AC_MSG_ERROR([No poppler library found. This library is required.])]) + AC_LANG_POP + else + CPPFLAGS="$CPPFLAGS $POPPLER_CFLAGS" + LIBS="$LIBS $POPPLER_LIBS" + AC_DEFINE([HAVE_POPPLER], [1]) + fi +else + splash_in_source='$(splash_objects)' + xpdf_in_source='$(xpdf_objects)' + xpdf_include=' -I xpdf ' +fi AC_SUBST([xpdf_in_source]) AC_SUBST([splash_in_source]) +AC_SUBST([xpdf_include]) # ------------------------------------------------------------------ @@ -574,6 +581,7 @@ AH_BOTTOM([ #ifdef HAVE_POPPLER #define GString GooString #define GHash GooHash +#define GHashIter GooHashIter #endif #ifdef HAVE_ZZIP_LIB_H diff --git a/lib/pdf/Makefile.in b/lib/pdf/Makefile.in index 4a70716..493c6ac 100644 --- a/lib/pdf/Makefile.in +++ b/lib/pdf/Makefile.in @@ -33,6 +33,8 @@ splash_objects = xpdf/SplashOutputDev.$(O) xpdf/SplashFont.$(O) xpdf/SplashState xpdf/SplashScreen.$(O) xpdf/SplashPath.$(O) xpdf/SplashXPath.$(O) xpdf/SplashXPathScanner.$(O) \ xpdf/SplashFTFontEngine.$(O) xpdf/SplashFTFontFile.$(O) xpdf/SplashFTFont.$(O) +xpdf_include = @xpdf_include@ + popplercompat.$(O): popplercompat.cc $(C) popplercompat.cc -o $@ fonts.$(O): fonts.c @@ -40,21 +42,21 @@ fonts.$(O): fonts.c bbox.$(O): bbox.c $(C) bbox.c -o $@ cmyk.$(O): cmyk.cc - $(CC) -I ./ -I xpdf cmyk.cc -o $@ + $(CC) -I ./ $(xpdf_include) cmyk.cc -o $@ GFXOutputDev.$(O): GFXOutputDev.cc GFXOutputDev.h CommonOutputDev.h InfoOutputDev.h ../gfxpoly.h - $(CC) -I ./ -I xpdf GFXOutputDev.cc -o $@ + $(CC) -I ./ $(xpdf_include) GFXOutputDev.cc -o $@ InfoOutputDev.$(O): InfoOutputDev.cc InfoOutputDev.h - $(CC) -I ./ -I xpdf InfoOutputDev.cc -o $@ + $(CC) -I ./ $(xpdf_include) InfoOutputDev.cc -o $@ BitmapOutputDev.$(O): BitmapOutputDev.cc BitmapOutputDev.h CommonOutputDev.h InfoOutputDev.h - $(CC) -I ./ -I xpdf BitmapOutputDev.cc -o $@ + $(CC) -I ./ $(xpdf_include) BitmapOutputDev.cc -o $@ XMLOutputDev.$(O): XMLOutputDev.cc XMLOutputDev.h xpdf/TextOutputDev.h - $(CC) -I ./ -I xpdf XMLOutputDev.cc -o $@ + $(CC) -I ./ $(xpdf_include) XMLOutputDev.cc -o $@ FullBitmapOutputDev.$(O): FullBitmapOutputDev.cc FullBitmapOutputDev.h CommonOutputDev.h InfoOutputDev.h - $(CC) -I ./ -I xpdf FullBitmapOutputDev.cc -o $@ + $(CC) -I ./ $(xpdf_include) FullBitmapOutputDev.cc -o $@ DummyOutputDev.$(O): DummyOutputDev.cc DummyOutputDev.h InfoOutputDev.h - $(CC) -I ./ -I xpdf DummyOutputDev.cc -o $@ + $(CC) -I ./ $(xpdf_include) DummyOutputDev.cc -o $@ pdf.$(O): pdf.cc GFXOutputDev.h InfoOutputDev.h CommonOutputDev.h BitmapOutputDev.h FullBitmapOutputDev.h InfoOutputDev.h - $(CC) -I ./ -I xpdf pdf.cc -o $@ + $(CC) -I ./ $(xpdf_include) pdf.cc -o $@ XPDFOK = xpdf/Gfx.cc ifeq ($(shell echo inject*xpdf.pl),inject-xpdf.pl) @@ -178,17 +180,17 @@ pdfinfo.$(O): $(XPDFOK) xpdf/pdfinfo.cc $(xpdf_objects) $(CC) -DXPDFEXE -I xpdf -I . xpdf/pdfinfo.cc pdftoppm$(E): $(XPDFOK) xpdf/pdftoppm.$(O) xpdf/parseargs.$(O) $(xpdf_objects) $(splash_objects) - $(LL) $(CPPFLAGS) -DXPDFEXE -g -I xpdf -I . xpdf/pdftoppm.$(O) $(xpdf_objects) $(splash_objects) xpdf/parseargs.$(O) -o pdftoppm$(E) $(LIBS) + $(LL) $(CPPFLAGS) -DXPDFEXE -g $(xpdf_include) -I . xpdf/pdftoppm.$(O) $(xpdf_objects) $(splash_objects) xpdf/parseargs.$(O) -o pdftoppm$(E) $(LIBS) pdftotext$(E): $(XPDFOK) xpdf/pdftotext.$(O) xpdf/parseargs.$(O) $(xpdf_objects) - $(LL) $(CPPFLAGS) -DXPDFEXE -g -I xpdf -I . xpdf/pdftotext.$(O) $(xpdf_objects) xpdf/parseargs.$(O) -o pdftotext$(E) $(LIBS) + $(LL) $(CPPFLAGS) -DXPDFEXE -g $(xpdf_include) -I . xpdf/pdftotext.$(O) $(xpdf_objects) xpdf/parseargs.$(O) -o pdftotext$(E) $(LIBS) pdfinfo$(E): $(XPDFOK) xpdf/pdfinfo.$(O) xpdf/parseargs.$(O) $(xpdf_objects) - $(LL) $(CPPFLAGS) -DXPDFEXE -g -I xpdf -I . xpdf/pdfinfo.$(O) $(xpdf_objects) xpdf/parseargs.$(O) -o pdfinfo$(E) $(LIBS) + $(LL) $(CPPFLAGS) -DXPDFEXE -g $(xpdf_include) -I . xpdf/pdfinfo.$(O) $(xpdf_objects) xpdf/parseargs.$(O) -o pdfinfo$(E) $(LIBS) gfx_objects = ../libgfxswf$(A) ../libgfx$(A) ../librfxswf$(A) ../libbase$(A) gfx_objects2 = $(gfx_objects) ../libocr$(A) pdf2jpeg$(E): $(XPDFOK) pdf2jpeg.c ../libbase$(A) xpdf/parseargs.$(O) $(xpdf_objects) $(splash_objects) - $(LL) $(CPPFLAGS) -DXPDFEXE -Ixpdf -I. -g pdf2jpeg.c xpdf/parseargs.$(O) ../libbase$(A) $(xpdf_objects) $(splash_objects) -o pdf2jpeg$(E) $(LIBS) + $(LL) $(CPPFLAGS) -DXPDFEXE $(xpdf_include) -I. -g pdf2jpeg.c xpdf/parseargs.$(O) ../libbase$(A) $(xpdf_objects) $(splash_objects) -o pdf2jpeg$(E) $(LIBS) pdf2swf$(E): $(XPDFOK) ../../src/pdf2swf.c $(libgfxpdf_objects) $(xpdf_in_source) $(splash_in_source) $(gfx_objects) $(LL) $(CPPFLAGS) -g ../../src/pdf2swf.c $(libgfxpdf_objects) $(xpdf_in_source) $(splash_in_source) $(gfx_objects) -o pdf2swf$(E) $(LIBS) pdf2pdf$(E): $(XPDFOK) ../../src/pdf2pdf.c $(libgfxpdf_objects) $(xpdf_in_source) $(splash_in_source) $(gfx_objects) -- 1.7.10.4