summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2019-08-19 02:54:47 +0200
committerSlávek Banko <slavek.banko@axis.cz>2019-08-19 02:55:02 +0200
commitac963b46a4c87c1ac6a05491a77b9087afeb47ab (patch)
tree23daecdfd9a695632671b5fb81b2da050b73765e
parenta9fc8babebae7c92b8d8fba0b06935adeca77bae (diff)
downloadlibkexiv2-ac963b46a4c87c1ac6a05491a77b9087afeb47ab.tar.gz
libkexiv2-ac963b46a4c87c1ac6a05491a77b9087afeb47ab.zip
Fix FTBFS with exiv2 >= 0.27.
This resolves bug 3017. Signed-off-by: Slávek Banko <slavek.banko@axis.cz> (cherry picked from commit 0b786b627502132d2ccea1785a0743a22b3f3736)
-rw-r--r--ConfigureChecks.cmake2
-rw-r--r--config.h.cmake3
-rw-r--r--libkexiv2/configure.in.in19
-rw-r--r--libkexiv2/libkexiv2/kexiv2private.h8
4 files changed, 26 insertions, 6 deletions
diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake
index 7c18e99..b582576 100644
--- a/ConfigureChecks.cmake
+++ b/ConfigureChecks.cmake
@@ -32,6 +32,8 @@ if( NOT EXIV2_FOUND )
tde_message_fatal( "exiv2 is required, but was not found on your system" )
endif( NOT EXIV2_FOUND )
+check_include_file_cxx( "exiv2/exiv2.hpp" HAVE_EXIV2_HPP )
+
##### check for <kdemacros.h> header
diff --git a/config.h.cmake b/config.h.cmake
index b26b50a..1b91529 100644
--- a/config.h.cmake
+++ b/config.h.cmake
@@ -7,5 +7,8 @@
significant byte first (like Motorola and SPARC, unlike Intel). */
#cmakedefine WORDS_BIGENDIAN @WORDS_BIGENDIAN@
+/* Defined if you have <exiv2/exiv2.hpp> header */
+#cmakedefine HAVE_EXIV2_HPP 1
+
/* Defined if you have <kdemacros.h> header */
#cmakedefine KDEMACROS_USABLE 1
diff --git a/libkexiv2/configure.in.in b/libkexiv2/configure.in.in
index b37e50f..0b79e84 100644
--- a/libkexiv2/configure.in.in
+++ b/libkexiv2/configure.in.in
@@ -17,6 +17,19 @@ if test "x$have_exiv2" != "xyes"; then
DO_NOT_COMPILE="libkexiv2 $DO_NOT_COMPILE"
fi
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+SAVE_CPPFLAGS=$CPPFLAGS
+SAVE_CXXFLAGS=$CXXFLAGS
+CPPFLAGS="$CPPFLAGS $EXIV2_CFLAGS"
+CXXFLAGS="$CXXFLAGS $USE_EXCEPTIONS $EXIV2_CFLAGS"
+AC_CHECK_HEADER(exiv2/exiv2.hpp,
+ [ AC_DEFINE(HAVE_EXIV2_HPP, 1, [Defined if you have <exiv2/exiv2.hpp> header]) ]
+)
+CPPFLAGS=$SAVE_CPPFLAGS
+CXXFLAGS=$SAVE_CXXFLAGS
+AC_LANG_RESTORE
+
AC_OUTPUT([ libkexiv2/libkexiv2.pc ])
# -----------------------------------------------------------------
@@ -45,9 +58,3 @@ AC_COMPILE_IFELSE(
)
CPPFLAGS=$libkexiv2_kdemacros_cppflags
AC_LANG_POP(C++)
-
-
-
-
-
-
diff --git a/libkexiv2/libkexiv2/kexiv2private.h b/libkexiv2/libkexiv2/kexiv2private.h
index 31a5dcf..952e48a 100644
--- a/libkexiv2/libkexiv2/kexiv2private.h
+++ b/libkexiv2/libkexiv2/kexiv2private.h
@@ -24,6 +24,10 @@
#ifndef KEXIV2_PRIVATE_H
#define KEXIV2_PRIVATE_H
+#if defined( HAVE_CONFIG_H )
+#include "config.h"
+#endif
+
// C++ includes.
#include <cstdlib>
@@ -54,6 +58,9 @@
// See http://gcc.gnu.org/wiki/Visibility, the section about c++ exceptions.
// They are needed for all libexiv2 versions that do not care about visibility.
#pragma GCC visibility push(default)
+#if defined(HAVE_EXIV2_HPP)
+#include <exiv2/exiv2.hpp>
+#else
#include <exiv2/error.hpp>
#include <exiv2/image.hpp>
#include <exiv2/jpgimage.hpp>
@@ -61,6 +68,7 @@
#include <exiv2/tags.hpp>
#include <exiv2/types.hpp>
#include <exiv2/exif.hpp>
+#endif
#pragma GCC visibility pop
// Check if Exiv2 support XMP