[Libreoffice-commits] core.git: config_host/config_poppler.h.in configure.ac sdext/source

Tomáš Chvátal tomas.chvatal at gmail.com
Tue Apr 21 06:11:21 PDT 2015


 config_host/config_poppler.h.in                       |   10 ++++++++++
 configure.ac                                          |    9 ++++++---
 sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx |    8 ++++++++
 3 files changed, 24 insertions(+), 3 deletions(-)

New commits:
commit 697804f48f4217dab145d96175c6cddf560ec614
Author: Tomáš Chvátal <tomas.chvatal at gmail.com>
Date:   Thu Apr 16 10:13:06 2015 +0200

    Make cpp/poppler-version.h header optional
    
    Older popler (SLE11) does not have this header yet.
    With the code simply if the header not found define version to oldest
    possible working candidate and also raise the .pc check to the same.
    
    Change-Id: I039c879879188fe2eb90cd119b80a1d6354a6a9c
    Reviewed-on: https://gerrit.libreoffice.org/15339
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/config_host/config_poppler.h.in b/config_host/config_poppler.h.in
new file mode 100644
index 0000000..458c49b
--- /dev/null
+++ b/config_host/config_poppler.h.in
@@ -0,0 +1,10 @@
+/*
+Settings for poppler header file dection
+*/
+
+#ifndef CONFIG_POPPLER_H
+#define CONFIG_POPPLER_H
+
+#define HAVE_POPPLER_VERSION_H 0
+
+#endif
diff --git a/configure.ac b/configure.ac
index 38e2beb..0d492ad 100644
--- a/configure.ac
+++ b/configure.ac
@@ -10434,14 +10434,15 @@ if test $_os != Android -a $_os != iOS -a \( -z "$enable_pdfimport" -o "$enable_
     if test "$with_system_poppler" = "yes"; then
         AC_MSG_RESULT([external])
         SYSTEM_POPPLER=TRUE
-        PKG_CHECK_MODULES( POPPLER, poppler >= 0.8.0 )
+        PKG_CHECK_MODULES( POPPLER, poppler >= 0.12.0 )
         AC_LANG_PUSH([C++])
         save_CXXFLAGS=$CXXFLAGS
         save_CPPFLAGS=$CPPFLAGS
         CXXFLAGS="$CXXFLAGS $POPPLER_CFLAGS"
         CPPFLAGS="$CPPFLAGS $POPPLER_CFLAGS"
-        AC_CHECK_HEADER([cpp/poppler-version.h], [],
-                   [AC_MSG_ERROR([cpp/poppler-version.h not found. Install poppler])], [])
+        AC_CHECK_HEADER([cpp/poppler-version.h],
+            [AC_DEFINE([HAVE_POPPLER_VERSION_H], 1)],
+            [])
         CXXFLAGS=$save_CXXFLAGS
         CPPFLAGS=$save_CPPFLAGS
         AC_LANG_POP([C++])
@@ -10451,6 +10452,7 @@ if test $_os != Android -a $_os != iOS -a \( -z "$enable_pdfimport" -o "$enable_
         AC_MSG_RESULT([internal])
         SYSTEM_POPPLER=
         BUILD_TYPE="$BUILD_TYPE POPPLER"
+        AC_DEFINE([HAVE_POPPLER_VERSION_H], 1)
     fi
 else
     AC_MSG_RESULT([no])
@@ -13004,6 +13006,7 @@ AC_CONFIG_HEADERS([config_host/config_vcl.h])
 AC_CONFIG_HEADERS([config_host/config_vclplug.h])
 AC_CONFIG_HEADERS([config_host/config_version.h])
 AC_CONFIG_HEADERS([config_host/config_oauth2.h])
+AC_CONFIG_HEADERS([config_host/config_poppler.h])
 AC_OUTPUT
 
 if test "$CROSS_COMPILING" = TRUE; then
diff --git a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx
index d15491b..f4fa810 100644
--- a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx
+++ b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.hxx
@@ -21,6 +21,7 @@
 #define INCLUDED_SDEXT_SOURCE_PDFIMPORT_XPDFWRAPPER_PDFIOUTDEV_GPL_HXX
 
 #include <sal/types.h>
+#include <config_poppler.h>
 
 #if defined __GNUC__
 # pragma GCC diagnostic push
@@ -50,7 +51,14 @@
 class GfxPath;
 class GfxFont;
 class PDFDoc;
+#if HAVE_POPPLER_VERSION_H
 #include <cpp/poppler-version.h>
+#else
+#define POPPLER_VERSION "0.12.3"
+#define POPPLER_VERSION_MAJOR 0
+#define POPPLER_VERSION_MINOR 12
+#define POPPLER_VERSION_MICRO 3
+#endif
 #define POPPLER_CHECK_VERSION(major,minor,micro) \
   (POPPLER_VERSION_MAJOR > (major) || \
    (POPPLER_VERSION_MAJOR == (major) && POPPLER_VERSION_MINOR > (minor)) || \


More information about the Libreoffice-commits mailing list